CVE-2026-41889 — pgx
Fix: jackc/pgx@60644f8CVE-2026-41889 is a SQL Injection vulnerability in github.com/jackc/pgx/v5. A fix is available for github.com/jackc/pgx/v5 — see the affected versions and patch details below.
pgx: SQL Injection via placeholder confusion with dollar quoted string literals
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-41889.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
github.com/jackc/pgx/v5🐹github.com/jackc/pgx/v4🐹github.com/jackc/pgxReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Impact
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.
- The value of that placeholder is controllable by the attacker.
e.g.
attackValue := `$tag$; drop table canary; --`
_, err = tx.Exec(ctx, `select $tag$ $1 $tag$, $1`, pgx.QueryExecModeSimpleProtocol, attackValue)
This is unlikely to occur outside of a contrived scenario.
Patches
The problem is resolved in v5.9.2.
Workarounds
Do not use the simple protocol to execute queries matching all the above conditions.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/jackc/pgx/v5 | all versions | 5.9.2go get github.com/jackc/pgx/v5@v5.9.2 |
| 🐹Go | github.com/jackc/pgx/v4 | all versions | No fix |
| 🐹Go | github.com/jackc/pgx | all versions | No fix |
Affected Products
pgxjackcDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/jackc/pgx/v5, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/jackc/pgx/v5 to 5.9.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-41889 is resolved across your whole dependency graph.
Workarounds
Until you can upgrade, make sure every query built from user input uses parameterised statements or a prepared-statement API rather than string concatenation, and reduce the database account's privileges so an injected query cannot read or alter data beyond what the feature needs.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat has rated this flaw as Moderate because the SQL injection vulnerability in pgx can only be triggered when the non-default simple protocol is used in conjunction with specific query constructions involving PostgreSQL dollar-quoted string literals. Successful exploitation requires multiple uncommon…
Avoid using the non-default simple protocol in applications that use the pgx PostgreSQL driver for Go. The vulnerability is contingent on this non-default protocol and specific SQL query constructs. Configuring applications to use the default extended protocol prevents this issue. If the simple protocol is necessary, ensure that dollar-quoted string literals do not contain attacker-controlled placeholder values.Source: Red Hat security advisory for CVE-2026-41889 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Advanced Cluster Security 4.9 | advanced-cluster-security/rhacs-main-rhel8:1785413210 | RHSA-2026:48872 |
| Red Hat Advanced Cluster Security for Kubernetes for IBM Power, little endian 4.10 | advanced-cluster-security/rhacs-main-rhel8:1785420959 | RHSA-2026:48913 |
| Red Hat Hardened Images | go-fdo-server-main-1.0.1-0.2.hum1 | RHSA-2026:15856 |
| Red Hat Hardened Images | caddy-main-2.11.3-0.1.hum1 | RHSA-2026:16133 |
| Red Hat Hardened Images | cosign-main-3.1.1-0.1.hum1 | RHSA-2026:25138 |
Frequently Asked Questions
Is CVE-2026-41889 in your dependencies?
Find it across Go, including transitive dependencies.