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

- Priority: **Prioritise**
- Reason: Severe, CVSS 9.8 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 1% (FIRST, 04-12-2026)
- Next step: Check applicability and the vendor advisory: no fix release is recorded here
- Status: published
- Published: 2024-03-06 · Modified: 2024-12-12
- Aliases: UBUNTU-CVE-2024-27304, DEBIAN-CVE-2024-27304, CGA-2frh-r4hx-jwv6, CGA-2jg7-2h2j-4g5w, CGA-33v3-w5h5-fqx2, CGA-39cj-j8qm-3754, CGA-3c3w-p9gc-wfx9, CGA-3jm6-7hp3-54gx, CGA-3qpq-p92g-97g5, CGA-553q-w927-xm46, CGA-5rgm-vqhv-92r3, CGA-5rjh-w426-mwq3, CGA-6j59-h479-5hj8, CGA-8253-q34c-m2fw, CGA-82ch-2v8c-vm9h, CGA-9hpw-hqwf-cm98, CGA-9ph6-9mrp-2m92, CGA-c22m-79jv-wq94, CGA-cpg4-95h3-mchr, CGA-g368-fvrv-jcmh, CGA-g3c3-873q-jxcr, CGA-g4hw-ffh4-3x96, CGA-ggcp-f9x4-w37v, CGA-gpm4-g7f7-hcrf, CGA-hmx6-9594-fj25, CGA-hwwv-2jp4-8r83, CGA-j2qf-47c9-9v88, CGA-jhv2-9mqq-w5q7, CGA-jq38-rqfv-m4q4, CGA-m8pf-2w8h-rhhm, CGA-m9x5-gjm3-5pcj, CGA-mph5-w85v-847w, CGA-mrwv-8h7j-c5rq, CGA-mwgq-2p7x-w97w, CGA-p24g-wc7g-rmgj, CGA-p9qv-xc79-f244, CGA-px8v-pr6q-r6vw, CGA-q79c-w393-99qh, CGA-qgw5-g4g8-2g5m, CGA-qw2h-75x2-r25r, CGA-r3w3-632v-995v, CGA-rp9h-grw5-h4h4, CGA-rpc7-72m5-m6v4, CGA-v4wh-q8mw-rjq4, CGA-v9q8-7x36-v4xf, CGA-vc87-pxj2-57f6, CGA-w6hv-3w24-8fff, CGA-wv48-342g-cmv7, CGA-x2fj-mqgq-6ccj, CGA-x3q6-j9f6-p9j4, CGA-xm9p-mp2c-qv72, CGA-xwvq-cx8p-2x23, GHSA-7jwh-3vrq-q3m8, GHSA-mrww-27vc-gghv, GO-2024-2606, CGA-2774-jqh4-jg4h, CGA-2wcg-pp7c-q3m6, CGA-2wpr-2vwg-9gfh, CGA-369h-pq7q-4xpg, CGA-3vw2-ph6q-97mg, CGA-3w3c-fmwp-5pwc, CGA-47cf-g288-99r4, CGA-4fr6-rr89-j8ch, CGA-5x9g-mvgf-4674, CGA-66x7-64gq-rx3p, CGA-6w49-xh9j-5pgh, CGA-6x45-43vc-g5wc, CGA-854q-v2wr-hf3g, CGA-8jmc-jwfp-qwfj, CGA-8rc6-cvm2-v9m4, CGA-9gwr-xp3h-wpx4, CGA-f8fj-223h-34xf, CGA-ffqw-5jqh-ccvr, CGA-fmx8-7q3m-j4rc, CGA-fwf7-xm4j-vh6v, CGA-j2qg-hjwq-97cq, CGA-mc46-c7rr-w55r, CGA-mxw2-xpph-vh84, CGA-p59v-67jc-mvjw, CGA-pqhc-cfvh-fcq4, CGA-q722-fgp3-c38f, CGA-rrw3-gpm3-w4mc, CGA-rx74-cc3j-vjg6, CGA-vc52-cqj9-5hr9, CGA-vmcg-54pm-cp7r, CGA-rqqc-qwmr-qw72, CGA-wpg6-wc9h-774c, CGA-wrwc-r3c8-q89g, CGA-x45m-75rg-jwx8, CGA-xg8q-2wfg-f3pj, CGA-xq7r-jjgq-qm39
- Record: https://cvemate.com/vulnerability/CVE-2024-27304 · JSON: https://cvemate.com/vulnerability/CVE-2024-27304/json

## Description

```text
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.
```

## Signals

- CVSS: 9.8 critical (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS: 1.109%, percentile 66.998%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 79)

- chainguard amass (Chainguard): \< 4.2.0-r8
- chainguard argo-workflows (Chainguard): \< 3.5.5-r3
- chainguard argo-workflows-fips (Chainguard): \< 3.5.5-r2
- chainguard caddy (Chainguard): \< 2.7.6-r4
- chainguard caddy-fips (Chainguard): \< 2.7.6-r1
- chainguard falcosidekick-fips (Chainguard): \< 2.28.0-r3
- chainguard ferretdb (Chainguard): \< 1.20.1-r3
- chainguard k3s (Chainguard): \< 1.29.2-r3
- chainguard k3s-multicall (Chainguard): \< 1.29.2-r3
- chainguard k3s-static (Chainguard): \< 1.29.2-r3
- chainguard kine (Chainguard): \< 0.11.6-r2
- chainguard kots (Chainguard): \< 1.108.1-r0
- chainguard kube-bench (Chainguard): \< 0.7.2-r3
- chainguard kube-bench-fips (Chainguard): \< 0.7.2-r1
- chainguard spicedb (Chainguard): \< 1.30.0-r0
- chainguard src (Chainguard): \< 5.3.0-r2
- chainguard step (Chainguard): \< 0.28.6-r0
- chainguard step-ca (Chainguard): \< 0.25.2-r5
- chainguard tdbg (Chainguard): \< 1.23.0-r1
- chainguard tdbg-compat (Chainguard): \< 1.23.0-r1

## References

- <https://github.com/jackc/pgx/security/advisories/GHSA-mrww-27vc-gghv>
- <https://github.com/jackc/pgproto3/security/advisories/GHSA-7jwh-3vrq-q3m8>
- <https://github.com/jackc/pgproto3/commit/945c2126f6db8f3bea7eeebe307c01fe92bca007>
- <https://github.com/jackc/pgx/commit/adbb38f298c76e283ffc7c7a3f571036fea47fd4>
- <https://github.com/jackc/pgx/commit/c543134753a0c5d22881c12404025724cb05ffd8>
- <https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df>
- <https://www.youtube.com/watch?v=Tfg1B8u1yvE>
- <https://ubuntu.com/security/CVE-2024-27304>
- <https://www.cve.org/CVERecord?id=CVE-2024-27304>
- <https://security-tracker.debian.org/tracker/CVE-2024-27304>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/27xxx/CVE-2024-27304.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2024-27304>
- <https://github.com/jackc/pgproto3>
- <https://github.com/jackc/pgx>

---

Data as of 2026-12-05T10:27:55.208Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
