CVE-2026-41889: pgx: SQL Injection via placeholder confusion with dollar quoted string literals
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.
Other sources
pgx: SQL Injection via placeholder confusion with dollar quoted string literals
— Microsoft
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.31.0-22 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.14.1-15 - Upgrade
Upgrade
pgxto a version that resolves this vulnerability.Fixed in 5.9.2
Event History
Frequently Asked Questions
What is the severity of CVE-2026-41889?
CVE-2026-41889 is considered a high severity vulnerability due to the potential for SQL injection.
How do I fix CVE-2026-41889?
To fix CVE-2026-41889, upgrade the pgx library to version 5.9.2 or later.
What causes CVE-2026-41889?
CVE-2026-41889 is caused by SQL injection vulnerabilities that arise from a placeholder confusion with dollar quoted string literals.
Which versions of pgx are affected by CVE-2026-41889?
pgx versions prior to 5.9.2 are affected by CVE-2026-41889.
What is pgx in the context of CVE-2026-41889?
pgx is a PostgreSQL driver and toolkit for Go that is vulnerable to SQL injection in earlier versions.