Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 669A74758D7 for ; Mon, 19 Aug 2002 20:53:39 -0400 (EDT) Received: from ciderbox.stanaway.net (ciderbox.stanaway.net [170.76.50.98]) by postgresql.org (Postfix) with ESMTP id A51C547582E for ; Mon, 19 Aug 2002 20:53:37 -0400 (EDT) Received: by ciderbox.stanaway.net (Postfix, from userid 1000) id 053CA9320F; Mon, 19 Aug 2002 19:53:33 -0500 (CDT) Subject: [Fwd: Re: @(#) Mordred Labs advisory 0x0001: Buffer overflow in PostgreSQL] From: David Stanaway To: pgsql-admin@postgresql.org Content-Type: multipart/mixed; boundary="=-LU6orQa2iwhs/loKPzKq" X-Mailer: Ximian Evolution 1.0.7 Date: 19 Aug 2002 19:53:32 -0500 Message-Id: <1029804812.12796.24.camel@ciderbox> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/234 X-Sequence-Number: 5348 --=-LU6orQa2iwhs/loKPzKq Content-Type: text/plain Content-Transfer-Encoding: 7bit I thought I would throw this bugtraq post into the mix... -- David Stanaway --=-LU6orQa2iwhs/loKPzKq Content-Disposition: inline Content-Description: Forwarded message - Re: @(#) Mordred Labs advisory 0x0001: Buffer overflow in PostgreSQL Content-Type: message/rfc822 Return-Path: Delivered-To: david@stanaway.net Received: from outgoing.securityfocus.com (outgoing2.securityfocus.com [66.38.151.26]) by ciderbox.stanaway.net (Postfix) with ESMTP id 9E16A9320E for ; Mon, 19 Aug 2002 13:24:16 -0500 (CDT) Received: from lists.securityfocus.com (lists.securityfocus.com [66.38.151.19]) by outgoing.securityfocus.com (Postfix) with QMQP id 764338F2E6; Mon, 19 Aug 2002 11:13:36 -0600 (MDT) Mailing-List: contact bugtraq-help@securityfocus.com; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list bugtraq@securityfocus.com Delivered-To: moderator for bugtraq@securityfocus.com Received: (qmail 2967 invoked from network); 19 Aug 2002 17:18:46 -0000 To: Sir Mordred The Traitor Subject: Re: @(#) Mordred Labs advisory 0x0001: Buffer overflow in PostgreSQL References: <3d61116c.98e44ba2@s-mail.com> From: Florian Weimer Date: Mon, 19 Aug 2002 19:30:52 +0200 In-Reply-To: <3d61116c.98e44ba2@s-mail.com> (Sir Mordred The Traitor's message of "Mon, 19 Aug 2002 15:40:28 +0000") Message-ID: <87ptwe7o37.fsf@CERT.Uni-Stuttgart.DE> Lines: 38 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386-debian-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sir Mordred The Traitor writes: > --[ How to reproduce: > psql> select cash_words('-700000000000000000000000000000'); > pgReadData() -- backend closed the channel unexpectedly. > .... .... > The connection to the server was lost... > > --[ Solution: > Upgrade to version 7.2.1. PostgreSQL 7.2.1 has a buffer overflow bug in the date parser (which is invoked each time a string is converted to a datetime object). If a frontend does not perform proper date checking and rejects overlong date strings, a buffer is overwritten by parser. The string has to pass some checks of the parser, so it is not immediately obvious that this can be exploited. Denial of service is possible, though, especially if the frontend does not automatically reestablish the database connection. (All connections are affected, not just the one that is issueing the query.) To my knowledge, the PostgreSQL developers do not think this warrants an additional 7.2.x release. They expect that users do not trust the PostgreSQL parsers and write input validation checks. That gives me the creeps---how can I trust a database which manipulates complex in-memory and on-disk data structures to keep my data, if its developers say I shouldn't rely on a simple thing they wrote, such as a date parser? A different problem: "select cash_out(2);". Known for ages, no fix in sight (seems to be a design problem which is not easy to resolve). *sigh* -- Florian Weimer Weimer@CERT.Uni-Stuttgart.DE University of Stuttgart http://CERT.Uni-Stuttgart.DE/people/fw/ RUS-CERT fax +49-711-685-5898 --=-LU6orQa2iwhs/loKPzKq--