Skip to main content

pgx PostgreSQL driver EUVDEUVD-2026-28805

| CVE-2026-41889 LOW
SQL Injection (CWE-89)
2026-05-08 GitHub_M
2.3
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Attacker controls parameter input
  2. Delivery
    Application invokes pgx with simple protocol mode
  3. Exploit
    SQL parser enters dollar-quoted string
  4. Install
    Parser misinterprets embedded placeholder syntax
  5. C2
    Sanitizer substitutes attacker value into query
  6. Execute
    Modified SQL executes with unintended semantics
  7. Impact
    SQL 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 tx.Exec(ctx, "select $tag$ $1 $tag$, $1", pgx.QueryExecModeSimpleProtocol, userInput) where userInput is $tag$; DROP TABLE canary; -- would cause the sanitizer to treat the embedded $1 as a placeholder and substitute the malicious value, resulting in query modification. This requires both the developer to explicitly enable simple protocol mode (non-default) and the application to use dollar-quoted strings with embedded placeholders-a contrived but technically exploitable scenario.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

pgx < 5.9.2

Affected Packages

go github.com/jackc/pgx no fix
go github.com/jackc/pgx/v4 no fix
go github.com/jackc/pgx/v5 fix: 5.9.2
euvd pgx fix: 5.9.2

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

Vendor (GitHub_M) PRIMARY 2.3 LOW
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

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

4
Patch available
May 08, 2026 - 18:03 EUVD
CVSS changed
May 08, 2026 - 17:22 NVD
2.3 (LOW)
CVE Published
May 08, 2026 - 15:53 nvd
UNKNOWN (no severity yet)
CVE Published
May 08, 2026 - 15:53 nvd
LOW 2.3

DescriptionCVE.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

EPSS Score
0.0%
Top 99% exploitable
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment MSRC GitHub VulDB

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.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

12
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +12
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy