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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | golang-github-jackc-pgconn | no fix listed | DEBIAN-CVE-2024-27304 |
| Debian:13 | golang-github-jackc-pgconn | no fix listed | DEBIAN-CVE-2024-27304 |
| Debian:14 | golang-github-jackc-pgconn | 1.14.3-1 | DEBIAN-CVE-2024-27304 |
| Debian:12 | golang-github-jackc-pgx | no fix listed | DEBIAN-CVE-2024-27304 |
| Debian:13 | golang-github-jackc-pgx | 4.18.1-2 | DEBIAN-CVE-2024-27304 |
| Debian:14 | golang-github-jackc-pgx | 4.18.1-2 | DEBIAN-CVE-2024-27304 |
| Go | github.com/jackc/pgproto3 | 2.3.3 | GHSA-7jwh-3vrq-q3m8 |
| Go | github.com/jackc/pgproto3/v2 | 2.3.3 | GO-2024-2606 |
| Go | github.com/jackc/pgproto3/v2 | 2.3.3 | GHSA-7jwh-3vrq-q3m8 |
| Go | github.com/jackc/pgx | 4.18.2 | GHSA-mrww-27vc-gghv |
| Go | github.com/jackc/pgx | 5.5.4 | GHSA-mrww-27vc-gghv |
| Go | github.com/jackc/pgx | no fix listed | GO-2024-2606 |
| Go | github.com/jackc/pgx/v4 | 4.18.2 | GHSA-mrww-27vc-gghv |
| Go | github.com/jackc/pgx/v4 | 4.18.2 | GO-2024-2606 |
| Go | github.com/jackc/pgx/v5 | 5.5.4 | GHSA-mrww-27vc-gghv |
| Go | github.com/jackc/pgx/v5 | 5.5.4 | GO-2024-2606 |
| Ubuntu:24.04:LTS | golang-github-jackc-pgproto3 | no fix listed | UBUNTU-CVE-2024-27304 |
| Ubuntu:25.10 | golang-github-jackc-pgproto3 | no fix listed | UBUNTU-CVE-2024-27304 |
| Ubuntu:26.04:LTS | golang-github-jackc-pgproto3 | no fix listed | UBUNTU-CVE-2024-27304 |
| Ubuntu:26.10 | golang-github-jackc-pgproto3 | no fix listed | UBUNTU-CVE-2024-27304 |
| Ubuntu:22.04:LTS | golang-github-jackc-pgx | no fix listed | UBUNTU-CVE-2024-27304 |
| Ubuntu:24.04:LTS | golang-github-jackc-pgx | no fix listed | UBUNTU-CVE-2024-27304 |
| Ubuntu:25.10 | golang-github-jackc-pgx | no fix listed | UBUNTU-CVE-2024-27304 |
| Ubuntu:26.04:LTS | golang-github-jackc-pgx | no fix listed | UBUNTU-CVE-2024-27304 |
| Ubuntu:26.10 | golang-github-jackc-pgx | no fix listed | UBUNTU-CVE-2024-27304 |
Affected products (as reported)
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
- https://github.com/jackc/pgx/security/advisories/GHSA-mrww-27vc-gghv x_refsource_CONFIRM
- https://github.com/jackc/pgproto3/security/advisories/GHSA-7jwh-3vrq-q3m8 x_refsource_MISC
- https://github.com/jackc/pgproto3/commit/945c2126f6db8f3bea7eeebe307c01fe92bca007 x_refsource_MISC
- https://github.com/jackc/pgx/commit/adbb38f298c76e283ffc7c7a3f571036fea47fd4 x_refsource_MISC
- https://github.com/jackc/pgx/commit/c543134753a0c5d22881c12404025724cb05ffd8 x_refsource_MISC
- https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df x_refsource_MISC
- https://www.youtube.com/watch?v=Tfg1B8u1yvE x_refsource_MISC