pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Stanaway <david@stanaway.net>
To: pgsql-admin@postgresql.org
Subject: [Fwd: Re: @(#) Mordred Labs advisory 0x0001: Buffer overflow in PostgreSQL]
Date: 19 Aug 2002 19:53:32 -0500
Message-ID: <1029804812.12796.24.camel@ciderbox> (raw)

I thought I would throw this bugtraq post into the mix...

-- 
David Stanaway
Sir Mordred The Traitor <mordred@s-mail.com> 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

Message-ID: <1029804812.12796.24.camel@ciderbox>
Permalink:  ../1029804812.12796.24.camel@ciderbox/
Also on:    postgresql.org/message-id/1029804812.12796.24.camel@ciderbox

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: david@stanaway.net
  Subject: Re: [Fwd: Re: @(#) Mordred Labs advisory 0x0001: Buffer overflow in PostgreSQL]
  In-Reply-To: <1029804812.12796.24.camel@ciderbox>
  References: <1029804812.12796.24.camel@ciderbox>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox