Re: More PHP DB abstraction layer stuff

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: More PHP DB abstraction layer stuff
Дата
Msg-id 87k7gupin1.fsf@stark.dyndns.tv
обсуждение исходный текст
Ответ на More PHP DB abstraction layer stuff  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Ответы Re: More PHP DB abstraction layer stuff  (Dennis Gearon <gearond@cvc.net>)
Список pgsql-general
"Nigel J. Andrews" <nandrews@investsystems.co.uk> writes:

> One thing that always gets me is why people think quoting the ' in a string is
> a security feature when they don't allow for someone giving \' in the
> string. On the other hand I'm never sure how to protect against such 'odd
> number of escapes' attacks. Anyone got any clues? Does PQescape do it?

That just means you have to escape \ as well as '.

But the best way to deal with this is to use placeholders and prepared queries
and provide the data out of band. This completely sidesteps the issue and
guarantees you can't get it wrong by mistake ever. Mixing user-provided data
with program code is a recipe for security holes.

--
greg

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

Предыдущее
От: Mikhail Terekhov
Дата:
Сообщение: Re: DBD-Pg
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: Compiling 7.2.3 on RH 8.0