Re: SQL injection, php and queueing multiple statement - Mailing list pgsql-general

From paul rivers
Subject Re: SQL injection, php and queueing multiple statement
Date
Msg-id 48010D99.1040309@gmail.com
Whole thread Raw
In response to Re: SQL injection, php and queueing multiple statement  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
Gregory Stark wrote:
> "paul rivers" <rivers.paul@gmail.com> writes:
>
>
>>> If I can't, and I doubt there is a system that will let me enforce
>>> that policy at a reasonable cost, why not providing a safety net that
>>> will at least raise the bar for the attacker at a very cheap cost?
>>>
>> How do you do this? Disallow string concatenation and/or variable interpolation
>> for any string that's going to be shipped off to the database?
>>
>
> Actually there is a system that can do this. Perl with the -T option. It keeps
> track of which strings are "tainted" by user-input and functions like eval
> will cause errors if you try to pass them a tainted string. The database
> drivers support this and will trigger an error if they're passed a tainted
> string.
>
>

Good point. What happens in the case I query a string from the database,
and use this result to build another sql string via concatenation?
Assume the value in the database came from user input, albeit via
another source and not this script. Will taint catch this? (Genuine
question - I don't know.)




pgsql-general by date:

Previous
From: Gregory Stark
Date:
Subject: Re: SQL injection, php and queueing multiple statement
Next
From: Gregory Stark
Date:
Subject: Re: Postgres on shared network drive