Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconAttacker controls parameter input
-
DeliveryApplication invokes pgx with simple protocol mode
-
ExploitSQL parser enters dollar-quoted string
-
InstallParser misinterprets embedded placeholder syntax
-
C2Sanitizer substitutes attacker value into query
-
ExecuteModified SQL executes with unintended semantics
-
ImpactSQL injection achieved (data access or modification)
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 | Four conditions must all be satisfied: (1) The non-default simple protocol must be explicitly enabled via QueryExecModeSimpleProtocol parameter in the Exec, Query, or Batch call-default extended protocol is not vulnerable. (2) The SQL query must contain a dollar-quoted string literal using PostgreSQL syntax ($[tag]$...$[tag]$), which is uncommon in Go applications that typically use standard quote escaping or parameterization. (3) The content within the dollar-quoted string must include text that would be interpreted as a placeholder outside of a string (e.g., $1, $2, $99) when parsed without proper quote awareness. (4) The value of that placeholder (the parameter passed to pgx) must be controllable by the attacker-typically via user input. Applications using the default extended protocol, avoiding dollar-quoted strings in SQL, or not accepting user input as placeholder values are not vulnerable. The requirement for authentication (PR:L in CVSS) means local or network access must be paired with valid database credentials or application authentication, not bypassed. |
| Impact | This is a low-real-world-risk vulnerability despite basic CVSS parameters. CVSS 2.3 with AV:N/AC:H/AT:P/PR:L reflects the low severity correctly. Attack complexity is HIGH because multiple specific conditions must align: (1) application must explicitly enable non-default simple protocol mode via QueryExecModeSimpleProtocol, (2) SQL query must use dollar-quoted strings (uncommon in Go parameterized queries), (3) string literal must contain text resembling a placeholder, and (4) placeholder value must be attacker-controllable. The CVSS AT:P (prepared attack timing) and PR:L (requires authentication) further constrain exploitation. No active exploitation identified (no KEV status, no POC referenced). EPSS data not provided, but the technical requirements suggest this affects only deliberately configured applications with specific SQL patterns-not default configurations. Real-world impact is limited to niche scenarios where developers use both simple protocol mode (an atypical choice for production Go applications) and dollar-quoted strings in parameterized queries. This is correctly prioritized below network RCE vulnerabilities but above 'CVE in feature nobody uses.' |
| Exploit ScenarioDerived | An authenticated application user submits input that becomes a parameter value (e.g., via form field or API request). The application uses pgx with simple protocol mode enabled and executes a query containing a dollar-quoted string with a placeholder-like substring. For example, code like |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 08, 2026
SQL injection vulnerability in pgx (Go PostgreSQL driver) prior to version 5.9.2 allows authenticated attackers to manipulate queries when the non-default simple protocol is used in conjunction with dollar-quoted string literals containing attacker-controlled placeholder-like text. The vulnerability requires specific configuration (simple protocol mode enabled) and precise SQL structure (dollar-quoted strings with embedded placeholder syntax), making exploitation unlikely in typical deployments but possible in applications explicitly using QueryExecModeSimpleProtocol.
RemediationAI
Vendor-released patch: pgx 5.9.2 or later. Users on pgx v5 should upgrade immediately to 5.9.2 using 'go get -u github.com/jackc/pgx/v5@v5.9.2'. Users on pgx v4 or v3 should migrate to pgx v5 and apply the patch, as no fix is available for older major versions. For applications unable to upgrade immediately, implement the primary workaround: disable the simple protocol mode by removing QueryExecModeSimpleProtocol from any Exec, Query, or Batch calls. Replace simple protocol invocations with the default extended protocol (omit the mode flag or explicitly use QueryExecModeExec for execution). This mitigation has no performance penalty in typical applications and is the recommended interim control. Alternatively, audit SQL queries to ensure no dollar-quoted strings are used in parameterized queries; rewrite dollar-quoted strings using standard PostgreSQL escaping. See GitHub Security Advisory GHSA-j88v-2chj-qfwx and release v5.9.2 for full context.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 4 packages in go, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
pgx is a PostgreSQL driver for Go that supports multiple query execution modes. PostgreSQL uses dollar-quoted strings (syntax: $[tag]$...$[tag]$) as an alternative to standard single-quoted strings for handling content containing quotes. The vulnerability stems from the query sanitizer/parser in internal/sanitize/sanitize.go failing to properly recognize and skip placeholder substitution within dollar-quoted string literals when using the simple protocol mode. The simple protocol differs from the extended protocol by transmitting full SQL with parameter values inline rather than via separate bind operations. When a dollar-quoted string contains text matching PostgreSQL placeholder syntax (e.g., $1, $2), the sanitizer previously treated this as an actual placeholder and substituted the attacker-controlled parameter value, resulting in SQL injection. The fix implements proper lexical analysis of dollar-quoted strings by tracking the opening tag and only terminating the quoted region when the matching closing tag is encountered, preventing placeholder recognition within those boundaries. Additionally, overflow protection was added to handle pathologically large placeholder numbers.
Know when Pgx 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
CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
Primary rating from Vendor (GitHub_M) · only source for this CVE.
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
4DescriptionCVE.org
pgx is a PostgreSQL driver and toolkit for Go. Prior to version 5.9.2, SQL injection can occur when the non-default simple protocol is used, a dollar quoted string literal is used in the SQL query, that string literal contains text that would be would be interpreted as a placeholder outside of a string literal, and the value of that placeholder is controllable by the attacker. This issue has been patched in version 5.9.2.
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.
pgx is a PostgreSQL driver and toolkit for Go. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploi
pgx is a PostgreSQL driver and toolkit for Go. Rated high severity (CVSS 8.1), this vulnerability is remotely exploitabl
EUVD-2026-28805
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB