Re: [HACKERS] Disallowing multiple queries per PQexec()

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: [HACKERS] Disallowing multiple queries per PQexec()
Дата
Msg-id eeb56ded-2d74-4363-84b4-8ed5f2943e85@manitou-mail.org
обсуждение исходный текст
Ответ на Re: [HACKERS] Disallowing multiple queries per PQexec()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
    Tom Lane wrote:

> Bearing in mind that I'm not really for this at all...

It's a band-aid, but certainly there are cases
where a DBA confronted to a badly written website
would just want to be able to: ALTER USER webuser SET allow_multiple_queries TO off;

> But if an attacker is able to inject a SET command,
> he's already found a way around it.  So there's no real
> point in locking down the GUC to prevent that.

I can think of the following case, where given the SQL-injectable  select id from users where email='$email';
an attacker would submit this string in $email: foo' AND set_config('allow_multiple_queries', 'on', false)='on
which opens the rest of the session for a second injection, this
time in the form of several colon-separated commands that
would do the actual damage.


Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: [HACKERS] standby server crashes hard on out-of-disk-space in HEAD
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: [HACKERS] Why restore_command is called for existing files in pg_xlog?