Skip site navigation (1) Skip section navigation (2)

Re: Protection from SQL injection

From: "Tom Dunstan" <pgsql(at)tomd(dot)cc>
To: "Thomas Mueller" <thomas(dot)tom(dot)mueller(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Protection from SQL injection
Date: 2008-04-29 14:14:29
Message-ID: ca33c0a30804290714q6a6c0f9frcb449ef58f546de0@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, Apr 29, 2008 at 12:25 AM, Thomas Mueller
<thomas(dot)tom(dot)mueller(at)gmail(dot)com> wrote:

>  What do you think about it? Do you think it makes sense to implement
>  this security feature in PostgreSQL as well? If not why not? Does
>  PostgreSQL have another solution or plan to solve the SQL injection
>  problem?

Damn, am I the only person who likes the idea?

To those suggesting that it's just treating the symptom: well of
course it is. But using e.g. Exec-Shield / PIE / stack protection
weren't bad ideas just because buffer overflows are the fault of the
application developer. And who wants to grep through every module they
install on their system every time they do an update just in case some
feature that they never use has added a bad query? Assuming they have
the source. PHP apps are notorious for it, of course, but it isn't
just them.

Now, I reckon the only way to sanely do it without mucking up people's
ad-hoc queries would be to have it as a permission that would default
to on, but be REVOKE-able. Then it can be revoked from the user/role
that $untrusted application connects as, but still allow people to get
in from a trusted account and get their hands dirty when they need to.

Would it catch ALL holes? No, as we saw in the order by case, and
there are probably others (not sure if I like the proposed solution
for that, btw). Would it catch a fair number? Absolutely.

Cheers

Tom

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-04-29 14:22:34
Subject: Re: SRF in SFRM_ValuePerCall mode
Previous:From: Alvaro HerreraDate: 2008-04-29 14:06:28
Subject: Re: [HACKERS] Proposed patch - psql wraps at window width

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group