9.8critical
pgx SQL Injection via Protocol Message Size Overflow
- Severity
- 9.8critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.11% (higher than 66% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-7jwh-3vrq-q3m8GHSA-mrww-27vc-gghvGO-2024-2606
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
| Product or package | Versions | Reported by |
|---|---|---|
| jackc pgx | < 4.18.2, >= 5.0.0, < 5.5.4, before 4.18.2, from 5.0.0 before 5.5.4 | CVE List, NVD |
| github.com/jackc/pgproto3 (Go) | before 2.3.3 | GitHub Advisory Database |
| github.com/jackc/pgproto3/v2 (Go) | before 2.3.3 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/jackc/pgx (Go) | before 4.18.2, from 5.0.0 before 5.5.4, all versions | GitHub Advisory Database, Go Vulnerability Database |
| github.com/jackc/pgx/v4 (Go) | before 4.18.2 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/jackc/pgx/v5 (Go) | from 5.0.0 before 5.5.4 | GitHub Advisory Database, Go Vulnerability Database |
| jackc pgproto3 | before 2.3.3 | NVD |
All scores
| GitHub_M | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 9.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | high 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 |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
Impact
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.
Patches
The problem is resolved in v2.3.3
Workarounds
Reject user input large enough to cause a single query or bind message to exceed 4 GB in size.
GitHub Advisory Database
Impact
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.
Patches
The problem is resolved in v4.18.2 and v5.5.4.
Workarounds
Reject user input large enough to cause a single query or bind message to exceed 4 GB in size.
Go Vulnerability Database
An integer overflow in the calculated message size of a query or bind message could allow a single large message to be sent as multiple messages under the attacker's control. This could lead to SQL injection if an attacker can cause a single query or bind message to exceed 4 GB in size.
NVD (es)
pgx es un controlador PostgreSQL y un conjunto de herramientas para Go. La inyección de SQL puede ocurrir si un atacante puede hacer que una sola consulta o mensaje de enlace supere los 4 GB de tamaño. Un desbordamiento de enteros en el tamaño del mensaje calculado puede provocar que un mensaje grande se envíe como varios mensajes bajo el control del atacante. El problema se resuelve en v4.18.2 y v5.5.4. Como solución alternativa, rechace la entrada del usuario lo suficientemente grande como para provocar que una sola consulta o mensaje vinculado supere los 4 GB de tamaño.
References
| https://github.com/jackc/pgx/security/advisories/GHSA-mrww-27vc-gghv | advisory, vendor-advisory, web | |
| https://github.com/jackc/pgproto3/security/advisories/GHSA-7jwh-3vrq-q3m8 | vendor-advisory, web | |
| https://github.com/jackc/pgproto3/commit/945c2126f6db8f3bea7eeebe307c01fe92bca007 | fix, patch, web | |
| https://github.com/jackc/pgx/commit/adbb38f298c76e283ffc7c7a3f571036fea47fd4 | fix, patch, web | |
| https://github.com/jackc/pgx/commit/c543134753a0c5d22881c12404025724cb05ffd8 | fix, patch, web | |
| https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df | fix, patch, web | |
| 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 | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-27304 changed 2024-12-12 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-7jwh-3vrq-q3m8 changed 2026-09-10 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-mrww-27vc-gghv changed 2026-09-10 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2024-2606 changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2024-27304 changed 2026-06-17 | Public domain |