CVE-2024-27304
JSON

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 packageVersionsReported by
jackc pgx< 4.18.2, >= 5.0.0, < 5.5.4, before 4.18.2, from 5.0.0 before 5.5.4CVE List, NVD
github.com/jackc/pgproto3 (Go)before 2.3.3GitHub Advisory Database
github.com/jackc/pgproto3/v2 (Go)before 2.3.3GitHub Advisory Database, Go Vulnerability Database
github.com/jackc/pgx (Go)before 4.18.2, from 5.0.0 before 5.5.4, all versionsGitHub Advisory Database, Go Vulnerability Database
github.com/jackc/pgx/v4 (Go)before 4.18.2GitHub Advisory Database, Go Vulnerability Database
github.com/jackc/pgx/v5 (Go)from 5.0.0 before 5.5.4GitHub Advisory Database, Go Vulnerability Database
jackc pgproto3before 2.3.3NVD

All scores

GitHub_M9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub9.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHubhigh CVSS:4.0CVSS: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

CWE-89CWE-190

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

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

Related

Sources

SourceRecordLicence
CVE ListCVE-2024-27304 changed 2024-12-12CVE Terms of Use
GitHub Advisory DatabaseGHSA-7jwh-3vrq-q3m8 changed 2026-09-10CC-BY-4.0
GitHub Advisory DatabaseGHSA-mrww-27vc-gghv changed 2026-09-10CC-BY-4.0
Go Vulnerability DatabaseGO-2024-2606 changed 2026-02-04CC-BY-4.0
NVDCVE-2024-27304 changed 2026-06-17Public domain