LowGO-2026-5004CVE-2026-41889GHSA-j88v-2chj-qfwx

SQL Injection via placeholder confusion with dollar quoted string literals in github.com/jackc/pgx

Published 22 Jun 2026 · Updated 25 Jun 2026

Is your project on an affected github.com/jackc/pgx?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected packages

Affected
All versions
Fixed in
No fix released
Affected
All versions
Fixed in
No fix released
Affected
<5.9.2
Fixed in
5.9.2
Update to the fixed version for your release line, for example:go get github.com/jackc/pgx/v5@v5.9.2

Details

SQL Injection can occur when using the non-default simple protocol with a dollar quoted string literal in the SQL query. If that string literal contains text that would be interpreted as a placeholder outside of a string literal, and the value of that placeholder is controllable by the attacker, an injection may be possible.

For example, an attacker could provide a value that includes a closing dollar quote followed by malicious SQL commands. This is unlikely to occur outside of a contrived scenario.

Is GO-2026-5004 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/jackc/pgx, and gives you the command that fixes it.

More advisories for github.com/jackc/pgx

  • LowCVE-2024-27304SQL injection in github.com/jackc/pgproto3 and github.com/jackc/pgx · 14 Mar 2024
  • LowCVE-2024-27289SQL injection in github.com/jackc/pgx/v4 · 11 Mar 2024
  • HighCVE-2024-27304pgx SQL Injection via Protocol Message Size Overflow · 4 Mar 2024
  • HighCVE-2024-27289pgx SQL Injection via Line Comment Creation · 4 Mar 2024
github.com/jackc/pgx security overview

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.