pgsql: Reject substituting extension schemas or owners matching ["$'\].

Поиск
Список
Период
Сортировка
От Noah Misch
Тема pgsql: Reject substituting extension schemas or owners matching ["$'\].
Дата
Msg-id E1qSzxL-000sE2-Mf@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Reject substituting extension schemas or owners matching ["$'\].

Substituting such values in extension scripts facilitated SQL injection
when @extowner@, @extschema@, or @extschema:...@ appeared inside a
quoting construct (dollar quoting, '', or "").  No bundled extension was
vulnerable.  Vulnerable uses do appear in a documentation example and in
non-bundled extensions.  Hence, the attack prerequisite was an
administrator having installed files of a vulnerable, trusted,
non-bundled extension.  Subject to that prerequisite, this enabled an
attacker having database-level CREATE privilege to execute arbitrary
code as the bootstrap superuser.  By blocking this attack in the core
server, there's no need to modify individual extensions.  Back-patch to
v11 (all supported versions).

Reported by Micah Gate, Valerie Woolard, Tim Carey-Smith, and Christoph
Berg.

Security: CVE-2023-39417

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/eb044d8f0aee1ba4950b0867f6ca9328374318db

Modified Files
--------------
src/backend/commands/extension.c                   | 16 ++++++++++++
src/test/modules/test_extensions/Makefile          |  6 +++--
.../test_extensions/expected/test_extensions.out   | 30 ++++++++++++++--------
.../test_extensions/sql/test_extensions.sql        | 17 +++++++++---
.../test_extensions/test_ext_extschema--1.0.sql    |  5 ++++
.../test_extensions/test_ext_extschema.control     |  3 +++
6 files changed, 60 insertions(+), 17 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Don't Memoize lateral joins with volatile join conditions
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Last-minute updates for release notes.