CVE-2024-27304pgx SQL Injection via Protocol Message Size Overflow
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.
What to do
Fixed builds are available from Debian, Go: see the table below for the fixed version per release.
Debian, 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-pgproto3 | Fix pending | UBUNTU-CVE-2024-27304 | |
| Ubuntu 26.10 | golang-github-jackc-pgx | Fix pending | UBUNTU-CVE-2024-27304 | |
| Ubuntu 26.04 | golang-github-jackc-pgproto3 | Under investigation | UBUNTU-CVE-2024-27304 | |
| Ubuntu 26.04 | golang-github-jackc-pgx | Under investigation | UBUNTU-CVE-2024-27304 | |
| Ubuntu 25.10 | golang-github-jackc-pgproto3 | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2024-27304 | |
| Ubuntu 25.10 | golang-github-jackc-pgx | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2024-27304 | |
| Ubuntu 24.04 | golang-github-jackc-pgproto3 | Under investigation | UBUNTU-CVE-2024-27304 | |
| Ubuntu 24.04 | golang-github-jackc-pgx | Under investigation | UBUNTU-CVE-2024-27304 | |
| Ubuntu 22.04 | golang-github-jackc-pgx | Under investigation | UBUNTU-CVE-2024-27304 | |
| Debian 14 | golang-github-jackc-pgconn | Fixed | 1.14.3-1 | DEBIAN-CVE-2024-27304 |
| Debian 14 | golang-github-jackc-pgx | Fixed | 4.18.1-2 | DEBIAN-CVE-2024-27304 |
| Debian 13 | golang-github-jackc-pgconn | Fix pending | DEBIAN-CVE-2024-27304 | |
| Debian 13 | golang-github-jackc-pgx | Fixed | 4.18.1-2 | DEBIAN-CVE-2024-27304 |
| Debian 12 | golang-github-jackc-pgconn | Fix pending | DEBIAN-CVE-2024-27304 | |
| Debian 12 | golang-github-jackc-pgx | Fix pending | DEBIAN-CVE-2024-27304 | |
| 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/pgproto3 | Fixed | 2.3.3 | GHSA-7jwh-3vrq-q3m8 |
| Go library | github.com/jackc/pgproto3/v2 | Fixed | 2.3.3 | GO-2024-2606 |
| Go library | github.com/jackc/pgx | Fixed | 4.18.2 | GHSA-mrww-27vc-gghv |
| Go library | github.com/jackc/pgx/v4 | Fixed | 4.18.2 | GO-2024-2606 |
| Go library | github.com/jackc/pgx/v5 | Fixed | 5.5.4 | GHSA-mrww-27vc-gghv |
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, >= 5.0.0, < 5.5.4
References
- https://github.com/jackc/pgx/security/advisories/GHSA-mrww-27vc-gghv
- https://github.com/jackc/pgproto3/security/advisories/GHSA-7jwh-3vrq-q3m8
- https://github.com/jackc/pgproto3/commit/945c2126f6db8f3bea7eeebe307c01fe92bca007
- https://github.com/jackc/pgx/commit/adbb38f298c76e283ffc7c7a3f571036fea47fd4
- https://github.com/jackc/pgx/commit/c543134753a0c5d22881c12404025724cb05ffd8
- https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df
- https://www.youtube.com/watch?v=Tfg1B8u1yvE
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.