{"id":"CVE-2024-27304","published":"2024-03-06T19:07:08Z","modified":"2024-12-12T20:52:24Z","title":"pgx SQL Injection via Protocol Message Size Overflow","vendor":"jackc","product":"pgx","tier":"tail","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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01484,"percentile":0.74235,"provenance":"source"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"},{"id":"CWE-190","name":"Integer Overflow or Wraparound"}],"references":[{"url":"https://github.com/jackc/pgx/security/advisories/GHSA-mrww-27vc-gghv","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/jackc/pgproto3/security/advisories/GHSA-7jwh-3vrq-q3m8","tags":["x_refsource_MISC"]},{"url":"https://github.com/jackc/pgproto3/commit/945c2126f6db8f3bea7eeebe307c01fe92bca007","tags":["x_refsource_MISC"]},{"url":"https://github.com/jackc/pgx/commit/adbb38f298c76e283ffc7c7a3f571036fea47fd4","tags":["x_refsource_MISC"]},{"url":"https://github.com/jackc/pgx/commit/c543134753a0c5d22881c12404025724cb05ffd8","tags":["x_refsource_MISC"]},{"url":"https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df","tags":["x_refsource_MISC"]},{"url":"https://www.youtube.com/watch?v=Tfg1B8u1yvE","tags":["x_refsource_MISC"]}],"priority":{"score":26.7,"factors":[{"name":"EPSS percentile","points":14.85},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":6.86}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2025-10-12","earliestUrl":"https://github.com/roaris/CVE-2024-27304-PoC","repos":[{"name":"roaris/CVE-2024-27304-PoC","url":"https://github.com/roaris/CVE-2024-27304-PoC","stars":1,"created":"2025-10-12"}]},"first":{"date":"2025-10-12","source":"PoC-in-GitHub","url":"https://github.com/roaris/CVE-2024-27304-PoC"},"provenance":"source"},"vendorSlug":"jackc","affectedVersions":[{"vendor":"jackc","product":"pgx","versions":["< 4.18.2",">= 5.0.0, < 5.5.4"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2024-03-06T20:31:57.168692Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"github.com/jackc/pgx","vulnerableRanges":["<4.18.2",">=5.0.0, <5.5.4","all versions"],"patched":["4.18.2","5.5.4"],"from":["GHSA-mrww-27vc-gghv","GO-2024-2606"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/jackc/pgx/v4","vulnerableRanges":["<4.18.2"],"patched":["4.18.2"],"from":["GHSA-mrww-27vc-gghv","GO-2024-2606"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/jackc/pgx/v5","vulnerableRanges":[">=5.0.0, <5.5.4"],"patched":["5.5.4"],"from":["GHSA-mrww-27vc-gghv","GO-2024-2606"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/jackc/pgproto3/v2","vulnerableRanges":["<2.3.3"],"patched":["2.3.3"],"from":["GO-2024-2606"],"provenance":"source"}],"summary":{"text":"The pgx PostgreSQL driver and toolkit for Go contains an integer overflow in how it calculates the size of query and bind protocol messages, which can let one oversized message be split into multiple messages under attacker control. An attacker who can make a single query or bind message exceed 4 GB can inject SQL.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T07:24:23Z"},"euvd":{"id":"EUVD-2024-0972","exploited":false,"provenance":"source"}}