Re: Possible problem with PQescapeStringConn and standard_conforming_strings

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Possible problem with PQescapeStringConn and standard_conforming_strings
Дата
Msg-id 27152.1161906364@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Possible problem with PQescapeStringConn and standard_conforming_strings  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Possible problem with PQescapeStringConn and  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-general
Jeff Davis <pgsql@j-davis.com> writes:
> You can set standard_conforming_strings in postgresql.conf at any time
> and reload the config, changing the value for all active connections.
> That means that if a client opens a connection, and you SIGHUP postgres,
> and then the client issues a PQescapeStringConn, the client will get an
> incorrectly-escaped string.

The window for this is pretty narrow, because PQescapeStringConn will
use the latest-delivered parameter status, but it's certainly true that
randomly changing standard_conforming_strings wouldn't be a bright idea.
Probably a documentation note recommending against changing it via
SIGHUP would be sufficient.

> This could be a security vulnerability. Webservers which hold open
> connections for long periods of time could be incorrectly escaping
> values for long periods of time

Not if they're using PQescapeStringConn.  Handmade escaping code
that thinks it needn't recheck the status could be at risk ...
but realistically, handmade escaping code is likely already broken
by the mere existence of standard_conforming_strings.

            regards, tom lane

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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Possible problem with PQescapeStringConn and
Следующее
От: Richard Broersma Jr
Дата:
Сообщение: Re: pg_dumpall failing from possible corrupted shared memory