Vulnerabilities in pkg:golang/github.com/jackc/pgx
PACKAGECVE-2026-41889 is a LOW sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting pgx libraries in the Go ecosystem. The issue involves sql injection via placeholder confusion with dollar quoted string literals. Remediation is available by upgrading affected packages to version 5.9.2.
pkg:golang/github.com/jackc/pgx
Vulnerability advisories affecting package pkg:golang/github.com/jackc/pgx. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-j88v-2chj-qfwx | CVE-2026-41889 | LOW | pgx: SQL Injection via placeholder confusion with dollar quoted string literals |
| GHSA-m7wr-2xf7-cm9p | CVE-2024-27289 | HIGH | pgx SQL Injection via Line Comment Creation |
| GHSA-mrww-27vc-gghv | CVE-2024-27304 | HIGH | pgx SQL Injection via Protocol Message Size Overflow |
CVE-2026-41889 at a Glance
How to Fix CVE-2026-41889
To remediate this vulnerability, upgrade all affected pgx dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/jackc/pgx/v5 to 5.9.2
Upgrade github.com/jackc/pgx/v4 to Latest secure release
Upgrade github.com/jackc/pgx to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/jackc/pgx/v5
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-41889, inspect your project dependencies for pgx:
inspect dependencies for github.com/jackc/pgx/v5
Analyze the terminal output to locate any version of pgx in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.9.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In pgx, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-41889 Affected pgx Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/jackc/pgx/v5
|
Go |
< 5.9.2
|
5.9.2
|
|
github.com/jackc/pgx/v4
|
Go |
≤ 4.18.3
|
|
|
github.com/jackc/pgx
|
Go |
≤ 3.6.2
|
|
References
Frequently Asked Questions
What is CVE-2026-41889?
Which pgx versions are affected?
What version fixes CVE-2026-41889?
Is github.com/jackc/pgx/v5 affected?
Is github.com/jackc/pgx/v4 affected?
What CWE is associated with CVE-2026-41889?
How can I check Go dependencies for CVE-2026-41889?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j88v-2chj-qfwx",
"modified" : "2026-05-13T13:30:26Z",
"published" : "2026-04-22T20:46:51Z",
"aliases" : [ "CVE-2026-41889" ],
"summary" : "pgx: SQL Injection via placeholder confusion with dollar quoted string literals",
"details" : "### Impact\n\nSQL Injection can occur when:\n\n1. The non-default simple protocol is used.\n2. A dollar quoted string literal is used in the SQL query.\n3. That string literal contains text that would be would be interpreted as a placeholder outside of a string literal.\n4. The value of that placeholder is controllable by the attacker.\n\ne.g.\n\n```go\nattackValue := `$tag$; drop table canary; --`\n_, err = tx.Exec(ctx, `select $tag$ $1 $tag$, $1`, pgx.QueryExecModeSimpleProtocol, attackValue)\n```\n\nThis is unlikely to occur outside of a contrived scenario.\n\n### Patches\n\nThe problem is resolved in v5.9.2.\n\n### Workarounds\n\nDo not use the simple protocol to execute queries matching all the above conditions.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/jackc/pgx/v5"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.9.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/jackc/pgx/v4"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "4.18.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/jackc/pgx"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "3.6.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jackc/pgx/security/advisories/GHSA-j88v-2chj-qfwx"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41889"
}, {
"type" : "WEB",
"url" : "https://github.com/jackc/pgx/commit/60644f84918a8af66d14a4b0d865d4edafd955da"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jackc/pgx"
}, {
"type" : "WEB",
"url" : "https://github.com/jackc/pgx/releases/tag/v5.9.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-22T20:46:51Z",
"nvd_published_at" : "2026-05-08T17:16:31Z"
}
}