CVE-2024-27304
CRITICAL 9.8CVSS 3.1pgproto3 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.
- Published
- 6 Mar 2024
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-190CWE-89
- Also known as
- GHSA-7jwh-3vrq-q3m8GHSA-mrww-27vc-gghvGO-2024-2606
- Sources
- NVDJSONOSV GHSA-7jwh-3vrq-q3m8JSONOSV GHSA-mrww-27vc-gghvJSONOSV GO-2024-2606JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U | |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | jackc | pgproto3cpe:2.3:a:jackc:pgproto3:*:*:*:*:*:go:*:* |
< 2.3.3 | 2.3.3 |
| NVD | jackc | pgxcpe:2.3:a:jackc:pgx:*:*:*:*:*:go:*:* |
< 4.18.2 | 4.18.2 |
| NVD | jackc | pgxcpe:2.3:a:jackc:pgx:*:*:*:*:*:go:*:* |
>= 5.0.0, < 5.5.4 | 5.5.4 |
| OSV | Go | github.com/jackc/pgproto3 | < 2.3.3 | 2.3.3 |
| OSV | Go | github.com/jackc/pgproto3/v2 | < 2.3.3 | 2.3.3 |
| OSV | Go | github.com/jackc/pgx | < 4.18.2 | 4.18.2 |
| OSV | Go | github.com/jackc/pgx | >= 5.0.0, < 5.5.4 | 5.5.4 |
| OSV | Go | github.com/jackc/pgx/v4 | < 4.18.2 | 4.18.2 |
| OSV | Go | github.com/jackc/pgx/v5 | >= 5.0.0, < 5.5.4 | 5.5.4 |
| OSV | Go | github.com/jackc/pgx | all versions |
References
- https://github.com/jackc/pgproto3/commit/945c2126f6db8f3bea7eeebe307c01fe92bca007 · Patch, WEB, FIX
- https://github.com/jackc/pgproto3/security/advisories/GHSA-7jwh-3vrq-q3m8 · Vendor Advisory, WEB
- https://github.com/jackc/pgx/commit/adbb38f298c76e283ffc7c7a3f571036fea47fd4 · Patch, WEB, FIX
- https://github.com/jackc/pgx/commit/c543134753a0c5d22881c12404025724cb05ffd8 · Patch, WEB, FIX
- https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df · Patch, WEB, FIX
- https://github.com/jackc/pgx/security/advisories/GHSA-mrww-27vc-gghv · Vendor Advisory, WEB, ADVISORY
- https://www.youtube.com/watch?v=Tfg1B8u1yvE · Press/Media Coverage, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-27304 · ADVISORY
- https://github.com/jackc/pgproto3 · PACKAGE
- https://github.com/jackc/pgx · PACKAGE
History
- 25 Nov 2026 20:55 UTC · NVD: first stored (published 6 Mar 2024)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 14 Mar 2024)
- 25 Nov 2026 20:13 UTC · OSV: first stored (published 4 Mar 2024)
- 25 Nov 2026 20:13 UTC · OSV: first stored (published 4 Mar 2024)