Vulnerability · Published Mar 6, 2024 · Assigned by GitHub_M

CVE-2024-27304pgx SQL Injection via Protocol Message Size Overflow

Critical 9.8

In plain English

A critical-severity SQL injection in pgx from jackc. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.1% (higher than 66% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)9.8Critical
Exploit odds (30 days)1.1%top 33.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

Official description

pgx is a PostgreSQL driver and toolkit for Go. SQL injection can occur if an attacker can cause a single query or bind message to exceed 4 GB in size. An integer overflow in the calculated message size can cause the one large message to be sent as multiple messages under the attacker's control. The problem is resolved in v4.18.2 and v5.5.4. As a workaround, reject user input large enough to cause a single query or bind message to exceed 4 GB in size.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12golang-github-jackc-pgconnno fix listedDEBIAN-CVE-2024-27304
Debian:13golang-github-jackc-pgconnno fix listedDEBIAN-CVE-2024-27304
Debian:14golang-github-jackc-pgconn1.14.3-1DEBIAN-CVE-2024-27304
Debian:12golang-github-jackc-pgxno fix listedDEBIAN-CVE-2024-27304
Debian:13golang-github-jackc-pgx4.18.1-2DEBIAN-CVE-2024-27304
Debian:14golang-github-jackc-pgx4.18.1-2DEBIAN-CVE-2024-27304
Gogithub.com/jackc/pgproto32.3.3GHSA-7jwh-3vrq-q3m8
Gogithub.com/jackc/pgproto3/v22.3.3GO-2024-2606
Gogithub.com/jackc/pgproto3/v22.3.3GHSA-7jwh-3vrq-q3m8
Gogithub.com/jackc/pgx4.18.2GHSA-mrww-27vc-gghv
Gogithub.com/jackc/pgx5.5.4GHSA-mrww-27vc-gghv
Gogithub.com/jackc/pgxno fix listedGO-2024-2606
Gogithub.com/jackc/pgx/v44.18.2GHSA-mrww-27vc-gghv
Gogithub.com/jackc/pgx/v44.18.2GO-2024-2606
Gogithub.com/jackc/pgx/v55.5.4GHSA-mrww-27vc-gghv
Gogithub.com/jackc/pgx/v55.5.4GO-2024-2606
Ubuntu:24.04:LTSgolang-github-jackc-pgproto3no fix listedUBUNTU-CVE-2024-27304
Ubuntu:25.10golang-github-jackc-pgproto3no fix listedUBUNTU-CVE-2024-27304
Ubuntu:26.04:LTSgolang-github-jackc-pgproto3no fix listedUBUNTU-CVE-2024-27304
Ubuntu:26.10golang-github-jackc-pgproto3no fix listedUBUNTU-CVE-2024-27304
Ubuntu:22.04:LTSgolang-github-jackc-pgxno fix listedUBUNTU-CVE-2024-27304
Ubuntu:24.04:LTSgolang-github-jackc-pgxno fix listedUBUNTU-CVE-2024-27304
Ubuntu:25.10golang-github-jackc-pgxno fix listedUBUNTU-CVE-2024-27304
Ubuntu:26.04:LTSgolang-github-jackc-pgxno fix listedUBUNTU-CVE-2024-27304
Ubuntu:26.10golang-github-jackc-pgxno fix listedUBUNTU-CVE-2024-27304

Affected products (as reported)

VendorProductVersions
jackc pgx < 4.18.2>= 5.0.0, < 5.5.4

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

References