CVE-2024-27304
published critical CVSS 3.1 · 9.8pgx SQL Injection via Protocol Message Size Overflow
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| jackc | — | pgx< 4.18.2 · >= 5.0.0, < 5.5.4 | Affected | Not stated | GitHub_M |
| jackc | — | pgx0 to < 4.18.2 · Other versions: unknown | Affected | Not stated | CISA-ADP |
| jackc | — | pgx5.0.0 to < 5.5.4 · Other versions: unknown | Affected | Not stated | CISA-ADP |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 9.8 / 10
- Severity
- critical
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| jackc | pgx | < 4.18.2 (affected)>= 5.0.0, < 5.5.4 (affected) | GitHub_M · cna |
| jackc | pgx | 0 to < 4.18.2 (affected · custom)Default: unknown | CISA-ADP · adp |
| jackc | pgx | 5.0.0 to < 5.5.4 (affected · custom)Default: unknown | CISA-ADP · adp |
Weaknesses
2- CWE-89 CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
- CWE-190 CWE-190: Integer Overflow or Wraparound
References
7- https://github.com/jackc/pgproto3/commit/945c2126f6db8f3bea7eeebe307c01fe92bca007
- https://github.com/jackc/pgproto3/security/advisories/GHSA-7jwh-3vrq-q3m8
- https://github.com/jackc/pgx/commit/adbb38f298c76e283ffc7c7a3f571036fea47fd4
- https://github.com/jackc/pgx/commit/c543134753a0c5d22881c12404025724cb05ffd8
- https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df
- https://github.com/jackc/pgx/security/advisories/GHSA-mrww-27vc-gghv
- https://www.youtube.com/watch?v=Tfg1B8u1yvE
Provider assertions
3GitHub_M · cna
pgx SQL Injection via Protocol Message Size Overflow
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 4cac13fe1fc25a0e4ef8c4eba5577e1077bde63ab44f1007fa817c99f1889110
- Ingested
- 23 Sep 2026, 08:20:47 UTC
- Source record
- Official CVE record