CVE-2023-39417
postgresql: extension script @substitutions@ within quoting allow SQL injection
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · August 10, 2023
Updated · November 1, 2026
Description
IN THE EXTENSION SCRIPT, a SQL Injection vulnerability was found in PostgreSQL if it uses @extowner@, @extschema@, or @extschema:...@ inside a quoting construct (dollar quoting, '', or ""). If an administrator has installed files of a vulnerable, trusted, non-bundled extension, an attacker with database-level CREATE privilege can execute arbitrary code as the bootstrap superuser.
Statement
Bundled extensions are not vulnerable. Also, PostgreSQL will block this attack in the core server, so there's no need to modify individual extensions.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 7.5CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
CWE-89 · Improper Neutralization of Special Elements used in an SQL Command