Vulnerability · Published Mar 6, 2024 · Assigned by GitHub_M
CVE-2024-27289pgx SQL Injection via Line Comment Creation
High 8.1
In plain English
A high-severity SQL injection in pgx from jackc. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.8% (higher than 58% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | golang-github-jackc-pgx | no fix listed | DEBIAN-CVE-2024-27289 |
| Debian:13 | golang-github-jackc-pgx | 4.18.1-2 | DEBIAN-CVE-2024-27289 |
| Debian:14 | golang-github-jackc-pgx | 4.18.1-2 | DEBIAN-CVE-2024-27289 |
| Go | github.com/jackc/pgx | 4.18.2 | GHSA-m7wr-2xf7-cm9p |
| Go | github.com/jackc/pgx | no fix listed | GO-2024-2605 |
| Go | github.com/jackc/pgx/v4 | 4.18.2 | GO-2024-2605 |
| Go | github.com/jackc/pgx/v4 | 4.18.2 | GHSA-m7wr-2xf7-cm9p |
| Ubuntu:22.04:LTS | golang-github-jackc-pgx | no fix listed | UBUNTU-CVE-2024-27289 |
| Ubuntu:24.04:LTS | golang-github-jackc-pgx | no fix listed | UBUNTU-CVE-2024-27289 |
| Ubuntu:25.10 | golang-github-jackc-pgx | no fix listed | UBUNTU-CVE-2024-27289 |
| Ubuntu:26.04:LTS | golang-github-jackc-pgx | no fix listed | UBUNTU-CVE-2024-27289 |
| Ubuntu:26.10 | golang-github-jackc-pgx | no fix listed | UBUNTU-CVE-2024-27289 |
Affected products (as reported)
Weakness: CWE-89 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H