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.

Severity (CVSS 3.1)8.1High
Exploit odds (30 days)0.8%top 41.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
Debian:12golang-github-jackc-pgxno fix listedDEBIAN-CVE-2024-27289
Debian:13golang-github-jackc-pgx4.18.1-2DEBIAN-CVE-2024-27289
Debian:14golang-github-jackc-pgx4.18.1-2DEBIAN-CVE-2024-27289
Gogithub.com/jackc/pgx4.18.2GHSA-m7wr-2xf7-cm9p
Gogithub.com/jackc/pgxno fix listedGO-2024-2605
Gogithub.com/jackc/pgx/v44.18.2GO-2024-2605
Gogithub.com/jackc/pgx/v44.18.2GHSA-m7wr-2xf7-cm9p
Ubuntu:22.04:LTSgolang-github-jackc-pgxno fix listedUBUNTU-CVE-2024-27289
Ubuntu:24.04:LTSgolang-github-jackc-pgxno fix listedUBUNTU-CVE-2024-27289
Ubuntu:25.10golang-github-jackc-pgxno fix listedUBUNTU-CVE-2024-27289
Ubuntu:26.04:LTSgolang-github-jackc-pgxno fix listedUBUNTU-CVE-2024-27289
Ubuntu:26.10golang-github-jackc-pgxno fix listedUBUNTU-CVE-2024-27289

Affected products (as reported)

VendorProductVersions
jackc pgx < 4.18.2

Weakness: CWE-89 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

References