Re: [SECURITY] DoS attack on backend possible (was: Re: - Mailing list pgsql-hackers

From Florian Weimer
Subject Re: [SECURITY] DoS attack on backend possible (was: Re:
Date
Msg-id 8765yg2niw.fsf@CERT.Uni-Stuttgart.DE
Whole thread Raw
In response to Re: [SECURITY] DoS attack on backend possible (was: Re:  (Gavin Sherry <swm@linuxworld.com.au>)
Responses Re: [SECURITY] DoS attack on backend possible (was: Re:  (Gavin Sherry <swm@linuxworld.com.au>)
List pgsql-hackers
Gavin Sherry <swm@linuxworld.com.au> writes:

>> Yes, but if you just check that the date given by the user matches the
>> regular expression "[0-9]+-[0-9]+-[0-9]+", it's still possible to
>> crash the backend.

> Anyone who is using that regular expression in an attempt to validate a
> user supplied date is already in trouble.

I don't understand why extremely strict syntax checks are necessary.
The database has to parse it again anyway, and if you can't rely on
the database to get this simple parsing right, will it store your
data?  Such a reasoning doesn't seem to be too far-fetched to me

I would probably impose a length limit in the frontend that uses the
database, but the PostgreSQL documentation does not state that this is
a requirement (because the parsers in the backend are so fragile).

-- 
Florian Weimer                       Weimer@CERT.Uni-Stuttgart.DE
University of Stuttgart           http://CERT.Uni-Stuttgart.DE/people/fw/
RUS-CERT                          fax +49-711-685-5898


pgsql-hackers by date:

Previous
From: Florian Weimer
Date:
Subject: Re: [SECURITY] DoS attack on backend possible (was: Re:
Next
From: Michael Meskes
Date:
Subject: Re: Strange bahaviour