CVE-2024-27289pgx SQL Injection via Line Comment Creation
pgx is a PostgreSQL driver and toolkit for Go. Prior to version 4.18.2, SQL injection can occur when all of the following conditions are met: the non-default simple protocol is used; a placeholder for a numeric value must be immediately preceded by a minus; there must be a second placeholder for a string value after the first placeholder; both must be on the same line; and both parameter values must be user-controlled. The problem is resolved in v4.18.2. As a workaround, do not use the simple protocol or do not place a minus directly before a placeholder.
What to do
Fixed builds are available from Debian, Go: see the table below for the fixed version per release.
Debian, Red Hat, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | golang-github-jackc-pgx | Fix pending | UBUNTU-CVE-2024-27289 | |
| Ubuntu 26.04 | golang-github-jackc-pgx | Under investigation | UBUNTU-CVE-2024-27289 | |
| Ubuntu 25.10 | golang-github-jackc-pgx | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2024-27289 | |
| Ubuntu 24.04 | golang-github-jackc-pgx | Under investigation | UBUNTU-CVE-2024-27289 | |
| Ubuntu 22.04 | golang-github-jackc-pgx | Under investigation | UBUNTU-CVE-2024-27289 | |
| Debian 14 | golang-github-jackc-pgx | Fixed | 4.18.1-2 | DEBIAN-CVE-2024-27289 |
| Debian 13 | golang-github-jackc-pgx | Fixed | 4.18.1-2 | DEBIAN-CVE-2024-27289 |
| Debian 12 | golang-github-jackc-pgx | Fix pending | DEBIAN-CVE-2024-27289 | |
| Red Hat Enterprise Linux 10 | osbuild-composer | Fix pending Affected | ||
| Red Hat Enterprise Linux 10 | osbuild-composer-core | Fix pending Affected | ||
| Red Hat Enterprise Linux 10 | osbuild-composer-worker | Fix pending Affected | ||
| Red Hat Enterprise Linux 9 | osbuild-composer | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 9 | osbuild-composer-core | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 9 | osbuild-composer-dnf-json | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 9 | osbuild-composer-worker | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 8 | osbuild-composer | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 8 | osbuild-composer-core | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 8 | osbuild-composer-dnf-json | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 8 | osbuild-composer-worker | Will not fix Will not fix | ||
| Go library | github.com/jackc/pgx | Fixed | 4.18.2 | GHSA-m7wr-2xf7-cm9p |
| Go library | github.com/jackc/pgx/v4 | Fixed | 4.18.2 | GHSA-m7wr-2xf7-cm9p |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- jackc pgx: affected: < 4.18.2
References
- https://github.com/jackc/pgx/security/advisories/GHSA-m7wr-2xf7-cm9p
- https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.