Forbid use of LF and CR characters in database and role names
От | Michael Paquier |
---|---|
Тема | Forbid use of LF and CR characters in database and role names |
Дата | |
Msg-id | CAB7nPqRbDwmrZW-W6QW6AwiL1WoZJO4XJ-b1+_O4xyy67zn=Fw@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Forbid use of LF and CR characters in database and role names
Re: Forbid use of LF and CR characters in database and role names Re: Forbid use of LF and CR characters in database and role names Re: Forbid use of LF and CR characters in database and role names |
Список | pgsql-hackers |
Hi all, As CVE-2016-5424 has put recently in light, using LF and CR in database and role names can lead to unexpected problems in the way they are handled in logical backups or generated command lines. There is as well a comment in the code mentioning a potential restriction for that, precisely in fe_utils/string_utils.c: + * Forbid LF or CR characters, which have scant practical use beyond designing + * security breaches. The Windows command shell is unusable as a conduit for + * arguments containing LF or CR characters. A future major release should + * reject those characters in CREATE ROLE and CREATE DATABASE, because use + * there eventually leads to errors here. Note that pg_dump[all] and pg_upgrade already have safeguards against those things per the same routines putting quotes for execution as commands into psql and shell. So attached is a patch to implement this restriction in the backend, and I am adding that to the next CF for 10.0. Attached is as well a script able to trigger those errors. Thoughts? -- Michael
Вложения
В списке pgsql-hackers по дате отправления: