mirror of https://github.com/postgres/postgres
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-39417pull/140/head
parent
2bdd7b262f
commit
cd5f2a3570
@ -0,0 +1,5 @@ |
||||
/* src/test/modules/test_extensions/test_ext_extschema--1.0.sql */ |
||||
-- complain if script is sourced in psql, rather than via CREATE EXTENSION |
||||
\echo Use "CREATE EXTENSION test_ext_extschema" to load this file. \quit |
||||
|
||||
SELECT 1 AS @extschema@; |
@ -0,0 +1,3 @@ |
||||
comment = 'test @extschema@' |
||||
default_version = '1.0' |
||||
relocatable = false |
Loading…
Reference in new issue