Re: Potential vuln in example for "F.25.1.1. digest()"

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Potential vuln in example for "F.25.1.1. digest()"
Дата
Msg-id 1368591.1629225197@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Potential vuln in example for "F.25.1.1. digest()"  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-docs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tuesday, August 17, 2021, PG Doc comments form <noreply@postgresql.org>
> wrote:
>> in "F.25.1.1. digest()" you suggest:
>>
>> CREATE OR REPLACE FUNCTION sha1(bytea) returns text AS $$
>> SELECT encode(digest($1, 'sha1'), 'hex')
>> $$ LANGUAGE SQL STRICT IMMUTABLE;
>>
>> While this is a great example, it may expose a database app to
>> vulnerabilities if the attacker succeeds in overriding the function
>> sha1(...) in the app's user context (schema)

> You should read this:
> https://wiki.postgresql.org/wiki/A_Guide_to_CVE-2018-1058%3A_Protect_Your_Search_Path

Yeah.  I can't get terribly excited about trying to make this one
example unconditionally-secure; there are dozens if not hundreds
of similar cases in our docs.  Trying to make them all safe
against insecure search paths would mostly result in unreadable
examples.

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Potential vuln in example for "F.25.1.1. digest()"
Следующее
От: PG Doc comments form
Дата:
Сообщение: Unclear\mistakable description of UPDATE behaviour in "13.2.1. Read Committed Isolation Level"