Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate with database CREATE privilege
-
DeliveryCreate schema or role name containing newline
-
ExploitTrigger vulnerable non-bundled extension script substitution
-
ExecutionInject SQL into script context
-
ImpactExecute arbitrary code as bootstrap superuser
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Persistence The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires ALL of: (1) the attacker holds database-level CREATE privilege (PR:H per CVSS - authenticated); (2) a NON-bundled (third-party) extension is installed whose install/update script uses a vulnerable substitution pattern - PostgreSQL's bundled extensions are NOT affected; and (3) the attacker can control a schema or owner name and embed a newline or other special substring into it that reaches the script substitution. The decisive limiting factor is condition (2): deployments that use only bundled extensions are not exposed, which sharply narrows the real attack surface. There is no user-interaction requirement (UI:N), and the vector is reachable over a normal network database connection (AV:N). |
| Impact | This is a genuinely serious but access-gated privilege-escalation flaw (CWE-89 SQL injection) rather than a mass-exploitable remote threat. The input CVSS vector (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H, score 7.2) requires PR:H - the attacker must already hold database-level CREATE privilege - so this is authenticated abuse by an existing low-trust database principal, not an anonymous internet attacker. The full C:H/I:H/A:H impact reflects that successful exploitation yields arbitrary code execution as the bootstrap superuser, i.e. total database compromise. Key decision signals are mixed and partly absent: EPSS is NOT provided, so exploitation probability cannot be quantified; KEV status is not indicated, so treat as NOT listed (no confirmed active exploitation); no PoC or exploit reference is present (only the vendor advisory). The vuln.today Decision label is 'this_week', consistent with a real but non-emergency priority. One important nuance the CVSS does not capture: unlike the related CVE-2023-39417, this requires a NON-bundled (third-party) extension that contains a vulnerable script substitution pattern to be present - a meaningful real-world limiter that makes AC:L arguably optimistic. Net: a real priority for environments that install untrusted/third-party PostgreSQL extensions and grant CREATE to semi-trusted users, but lower practical urgency where only bundled extensions are used. |
| Exploit ScenarioDerived | A user who holds CREATE privilege on a PostgreSQL database (for example a tenant in a shared/multi-tenant deployment) creates a schema or role whose name embeds a newline or other special substring, then causes a vulnerable non-bundled extension's install/update script to perform its unsafe name substitution. The injected SQL runs during script execution and executes arbitrary code as the bootstrap superuser, fully compromising the database. No public exploit identified at time of analysis; the attack is authenticated (PR:H) and network-reachable over a normal database connection. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 12, 2026
SQL injection in PostgreSQL's extension-script substitution logic lets an authenticated database user who holds CREATE privilege execute arbitrary code as the bootstrap superuser. The flaw is not reachable on a stock installation: it requires a non-bundled (third-party) extension whose install or update script uses a vulnerable substitution pattern, plus the ability to plant a newline or other special substring in a schema or owner name that reaches that substitution. PostgreSQL releases before 18.7, 17.12, 16.16, 15.20 and 14.25 are affected; the supplied data shows no CISA KEV listing and no public exploit code.
RemediationAI
Upgrade the PostgreSQL server to a fixed release for your branch: 18.7, 17.12, 16.16, 15.20 or 14.25, as listed in the vendor advisory at https://www.postgresql.org/support/security/CVE-2026-120153/, which is the authoritative source for the fix. Because the defect surfaces through third-party code, updating the server is necessary but the vulnerable pattern also lives in the extension's SQL script: audit every non-bundled extension in use for install/update scripts that substitute schema or owner names into SQL without proper quoting, and update or replace those extensions where the upstream project has addressed the pattern. As a compensating control derived from the exploitation prerequisites, restrict database-level CREATE privilege to trusted roles only - this closes the required precondition but will break legitimate schema- and extension-management workflows for the roles from which it is removed, so scope it to untrusted or application-facing accounts rather than revoking it globally. No workaround substitute for the server upgrade is described in the available sources.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
PostgreSQL extensions ship as SQL scripts that the server executes during CREATE EXTENSION and ALTER EXTENSION UPDATE, with placeholders such as the target schema and object owner substituted into the script text at run time. The root cause here is CWE-89: schema or owner names are substituted into SQL statements without adequate quoting or escaping, so a name containing a newline or other special substring can terminate the intended identifier or literal and inject additional SQL. Because extension scripts can run with elevated (bootstrap superuser) privileges, a successful injection yields code execution in that context - the same class of problem as CVE-2023-39417, but here the vulnerable substitution pattern lives in a non-bundled extension script rather than in PostgreSQL's own bundled extensions, which are unaffected. Per the independent assessment the vector is network-reachable over a normal database connection with no user interaction, and exploitation is gated by three simultaneous conditions: database-level CREATE privilege, the presence of a third-party extension with the vulnerable script pattern, and attacker influence over a schema or owner name that is substituted into that script. The decisive limiting factor is the second condition - deployments using only bundled extensions are not exposed. The supplied CPE entry is a wildcard for PostgreSQL, so exact version matching must come from the vendor advisory's version ranges; the mechanism by which a name reaches the substitution in a given deployment is not described in the available sources.
Know when PostgreSQL gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
CREATE is a granted but non-admin privilege (PR:L), and the required presence of a vulnerable non-bundled extension is an attacker-independent precondition (AC:H); successful escalation to superuser gives full C/I/A impact.
Primary rating from Vendor (PostgreSQL).
CVSS VectorVendor: PostgreSQL
Lifecycle Timeline
2DescriptionCVE.org
SQL injection in PostgreSQL extension-script substitutions allows an attacker with database-level CREATE privilege to execute arbitrary code as the bootstrap superuser, via a schema or owner name containing newlines or other special substrings. This is similar to CVE-2023-39417, but it requires a non-bundled extension with a vulnerable script pattern. Versions before PostgreSQL 18.7, 17.12, 16.16, 15.20, and 14.25 are affected.
Articles & Coverage 1
Executive ViewAI
CVE-2026-120153 is a high-severity SQL injection in PostgreSQL that allows an authenticated database user to execute arbitrary code as a superuser, but only in environments with non-bundled (third-party) extensions that use a vulnerable substitution pattern. This primarily threatens organizations with custom or third-party database extensions, as stock installations are not affected. Given the potential for full database compromise, leadership should prioritize identification of affected installations and apply mitigations.
No vendor-released patch identified at time of analysis. Interim mitigations include restricting CREATE privilege on schemas to trusted users, carefully vetting and reviewing any non-bundled extensions for vulnerable substitution patterns, and monitoring database logs for suspicious activity. Where possible, disable or remove unnecessary third-party extensions.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
More in PostgreSQL
View allPostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re
Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.
Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar
PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow
The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t
A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra
In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve
Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the
Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot
Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al
EUVD-2026-124427
GHSA-w429-xmhm-p6jc
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB