# CVE-2024-27304: pgx SQL Injection via Protocol Message Size Overflow

- Severity: Critical 9.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.11%, higher than 66% of CVEs (2026-12-01)
- Published: 2024-03-04T20:43:24.000Z
- Modified: 2026-09-10T03:50:10.601Z
- Also known as: GHSA-7jwh-3vrq-q3m8, GHSA-mrww-27vc-gghv, GO-2024-2606
- Related: CGA-3c9g-45p3-h9m3
- Weaknesses: CWE-89, CWE-190
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- jackc pgx: < 4.18.2; >= 5.0.0, < 5.5.4; before 4.18.2; from 5.0.0 before 5.5.4
- github.com/jackc/pgproto3 (Go): before 2.3.3
- github.com/jackc/pgproto3/v2 (Go): before 2.3.3
- github.com/jackc/pgx (Go): before 4.18.2; from 5.0.0 before 5.5.4; all versions
- github.com/jackc/pgx/v4 (Go): before 4.18.2
- github.com/jackc/pgx/v5 (Go): from 5.0.0 before 5.5.4
- jackc pgproto3: before 2.3.3

## Every score

- GitHub_M: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 9.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:4.0 High `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`

## 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)

## Sources

- CVE List: [CVE-2024-27304](https://www.cve.org/CVERecord?id=CVE-2024-27304), CVE Terms of Use, modified 2024-12-12
- GitHub Advisory Database: [GHSA-7jwh-3vrq-q3m8](https://github.com/advisories/GHSA-7jwh-3vrq-q3m8), CC-BY-4.0, modified 2026-09-10
- GitHub Advisory Database: [GHSA-mrww-27vc-gghv](https://github.com/advisories/GHSA-mrww-27vc-gghv), CC-BY-4.0, modified 2026-09-10
- Go Vulnerability Database: [GO-2024-2606](https://pkg.go.dev/vuln/GO-2024-2606), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2024-27304](https://nvd.nist.gov/vuln/detail/CVE-2024-27304), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-27304 · Whole record: https://cve.day/CVE-2024-27304.json · Rebuilt by cve.day 2026-11-25T22:58:37.310Z
