{"id":"CVE-2024-27304","aliases":["AZL-35752","AZL-35762","DEBIAN-CVE-2024-27304","EUVD-2024-0972","GHSA-7jwh-3vrq-q3m8","GHSA-mrww-27vc-gghv","GO-2024-2606","UBUNTU-CVE-2024-27304"],"status":"published","title":"pgx SQL Injection via Protocol Message Size Overflow","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.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.01109,"percentile":0.66323,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-190","CWE-89"],"published":"2024-03-04T20:43:24Z","modified":"2026-11-02T12:02:00Z","exploits":[{"source":"pocgithub","id":"roaris/CVE-2024-27304-PoC","title":"roaris/CVE-2024-27304-PoC","date":"2025-10-12","url":"https://github.com/roaris/CVE-2024-27304-PoC"}],"fixes":[{"ecosystem":"Go","package":"github.com/jackc/pgproto3","fixed_in":["2.3.3"],"sources":["ghsa","osv"]},{"ecosystem":"Go","package":"github.com/jackc/pgproto3/v2","fixed_in":["2.3.3"],"sources":["ghsa","osv"]},{"ecosystem":"Go","package":"github.com/jackc/pgx","fixed_in":["4.18.2","5.5.4"],"sources":["ghsa","osv"]},{"ecosystem":"Go","package":"github.com/jackc/pgx/v4","fixed_in":["4.18.2"],"sources":["ghsa","osv"]},{"ecosystem":"Go","package":"github.com/jackc/pgx/v5","fixed_in":["5.5.4"],"sources":["ghsa","osv"]},{"ecosystem":"Azure Linux:3","package":"telegraf","fixed_in":["1.31.0-1"],"sources":["osv"]},{"ecosystem":"Azure Linux:2","package":"telegraf","fixed_in":["1.28.5-5"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"golang-github-jackc-pgconn","fixed_in":["1.14.3-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"golang-github-jackc-pgx","fixed_in":["4.18.1-2"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"golang-github-jackc-pgx","fixed_in":["4.18.1-2"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/jackc/pgproto3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.3"}]}]},{"source":"ghsa","ecosystem":"Go","package":"github.com/jackc/pgproto3/v2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.3"}]}]},{"source":"ghsa","ecosystem":"Go","package":"github.com/jackc/pgx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.18.2"}]}]},{"source":"ghsa","ecosystem":"Go","package":"github.com/jackc/pgx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.0.0"},{"fixed":"5.5.4"}]}]},{"source":"ghsa","ecosystem":"Go","package":"github.com/jackc/pgx/v4","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.18.2"}]}]},{"source":"ghsa","ecosystem":"Go","package":"github.com/jackc/pgx/v5","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.0.0"},{"fixed":"5.5.4"}]}]},{"source":"osv","ecosystem":"Azure Linux:3","package":"telegraf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.31.0-1"}]}]},{"source":"osv","ecosystem":"Azure Linux:2","package":"telegraf","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.28.5-5"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"golang-github-jackc-pgconn","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.11.0-2","1.14.0-1","1.14.3-1","1.14.3-1~exp0"]},{"source":"osv","ecosystem":"Debian:13","package":"golang-github-jackc-pgconn","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.14.0-1","1.14.3-1","1.14.3-1~exp0"]},{"source":"osv","ecosystem":"Debian:14","package":"golang-github-jackc-pgconn","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.14.3-1"}]}],"versions":["1.14.0-1","1.14.3-1~exp0"]},{"source":"osv","ecosystem":"Debian:12","package":"golang-github-jackc-pgx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.15.0-4","4.18.1-1","4.18.1-2","4.18.3-1","4.18.3-1~exp0","4.18.3-2"]},{"source":"osv","ecosystem":"Debian:13","package":"golang-github-jackc-pgx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.18.1-2"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"golang-github-jackc-pgx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.18.1-2"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/jackc/pgproto3","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.3.3"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/jackc/pgproto3/v2","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.3.3"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/jackc/pgx","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.18.2"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/jackc/pgx","ranges":[{"type":"SEMVER","events":[{"introduced":"5.0.0"},{"fixed":"5.5.4"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/jackc/pgx/v4","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.18.2"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/jackc/pgx/v5","ranges":[{"type":"SEMVER","events":[{"introduced":"5.0.0"},{"fixed":"5.5.4"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/jackc/pgproto3/v2","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.3.3"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/jackc/pgx","ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/jackc/pgx/v4","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.18.2"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/jackc/pgx/v5","ranges":[{"type":"SEMVER","events":[{"introduced":"5.0.0"},{"fixed":"5.5.4"}]}]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"golang-github-jackc-pgx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.6.2-2"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"golang-github-jackc-pgproto3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.2.0-2","2.3.2-1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"golang-github-jackc-pgx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.15.0-4","4.18.1-1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"golang-github-jackc-pgproto3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.3.2-1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"golang-github-jackc-pgx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.18.1-1","4.18.1-2"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"golang-github-jackc-pgproto3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.3.2-1","2.3.3-2"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"golang-github-jackc-pgx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.18.1-2","4.18.3-2"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"golang-github-jackc-pgproto3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.3.2-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"golang-github-jackc-pgx","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.18.1-2"]}],"products":[{"vendor":"jackc","product":"pgproto3"},{"vendor":"jackc","product":"pgx"}],"references":[{"url":"https://github.com/jackc/pgx/security/advisories/GHSA-mrww-27vc-gghv","tags":["x_refsource_CONFIRM","x_transferred","Vendor Advisory","advisory","web","report"]},{"url":"https://github.com/jackc/pgproto3/security/advisories/GHSA-7jwh-3vrq-q3m8","tags":["x_refsource_MISC","x_transferred","Vendor Advisory","advisory","web","report"]},{"url":"https://github.com/jackc/pgproto3/commit/945c2126f6db8f3bea7eeebe307c01fe92bca007","tags":["x_refsource_MISC","x_transferred","Patch","fix","web","report"]},{"url":"https://github.com/jackc/pgx/commit/adbb38f298c76e283ffc7c7a3f571036fea47fd4","tags":["x_refsource_MISC","x_transferred","Patch","fix","web","report"]},{"url":"https://github.com/jackc/pgx/commit/c543134753a0c5d22881c12404025724cb05ffd8","tags":["x_refsource_MISC","x_transferred","Patch","fix","web","report"]},{"url":"https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df","tags":["x_refsource_MISC","x_transferred","Patch","fix","web","report"]},{"url":"https://www.youtube.com/watch?v=Tfg1B8u1yvE","tags":["x_refsource_MISC","Press/Media Coverage","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-27304","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-7jwh-3vrq-q3m8"},{"url":"https://github.com/advisories/GHSA-mrww-27vc-gghv"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/27xxx/CVE-2024-27304.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2024-27304","tags":["advisory"]},{"url":"https://github.com/jackc/pgproto3","tags":["package"]},{"url":"https://github.com/jackc/pgx","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2024-27304","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2024-27304","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2024-27304","title":"pgx SQL Injection via Protocol Message Size Overflow","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.","status":"published","published":"2024-03-06T19:07:08.491Z","modified":"2024-12-12T20:52:24.821Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-89","CWE-190"],"updated_at":"2026-11-02T14:34:12.982241Z"}],"euvd":[{"id":"EUVD-2024-0972","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.","status":"published","published":"2024-03-06T19:07:08Z","modified":"2024-12-12T20:52:24Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-03T00:04:36.024922Z"}],"ghsa":[{"id":"GHSA-7jwh-3vrq-q3m8","title":"pgproto3 SQL Injection via Protocol Message Size Overflow","description":"### Impact\n\nSQL 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.\n\n### Patches\n\nThe problem is resolved in v2.3.3\n\n### Workarounds\n\nReject user input large enough to cause a single query or bind message to exceed 4 GB in size.\n","status":"published","published":"2024-03-04T20:45:25Z","modified":"2026-03-17T05:03:05Z","cvss":[{"version":"4.0","score":8.1,"vector":"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","level":"high"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-89","CWE-190"],"updated_at":"2026-11-02T14:39:36.642723Z"},{"id":"GHSA-mrww-27vc-gghv","title":"pgx SQL Injection via Protocol Message Size Overflow","description":"### Impact\n\nSQL 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.\n\n### Patches\n\nThe problem is resolved in v4.18.2 and v5.5.4.\n\n### Workarounds\n\nReject user input large enough to cause a single query or bind message to exceed 4 GB in size.\n","status":"published","published":"2024-03-04T20:43:24Z","modified":"2026-03-14T05:02:20Z","cvss":[{"version":"4.0","score":8.1,"vector":"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","level":"high"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-89","CWE-190"],"updated_at":"2026-11-02T14:39:35.644357Z"}],"nvd":[{"id":"CVE-2024-27304","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.","status":"published","published":"2024-03-06T19:15:08.767Z","modified":"2026-06-17T07:19:36.673Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"secondary"}],"cwes":["CWE-89","CWE-190"],"updated_at":"2026-11-02T14:09:39.488031Z"}],"osv":[{"id":"CVE-2024-27304","title":"pgx SQL Injection via Protocol Message Size Overflow","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.","status":"published","published":"2024-03-06T19:07:08.491Z","modified":"2026-10-28T02:30:46.917218221Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-190","CWE-89"],"updated_at":"2026-11-02T15:44:39.569658Z"},{"id":"DEBIAN-CVE-2024-27304","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.","status":"published","published":"2024-03-06T19:15:08.767Z","modified":"2026-11-02T12:02:00.958807551Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:45:42.204259Z"},{"id":"GHSA-7jwh-3vrq-q3m8","title":"pgproto3 SQL Injection via Protocol Message Size Overflow","description":"### Impact\n\nSQL 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.\n\n### Patches\n\nThe problem is resolved in v2.3.3\n\n### Workarounds\n\nReject user input large enough to cause a single query or bind message to exceed 4 GB in size.\n","status":"published","published":"2024-03-04T20:45:25Z","modified":"2026-09-10T03:50:00.236184063Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"},{"version":"4.0","score":8.1,"vector":"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","level":"high"}],"cwes":["CWE-190","CWE-89"],"updated_at":"2026-11-02T15:46:41.002603Z"},{"id":"GHSA-mrww-27vc-gghv","title":"pgx SQL Injection via Protocol Message Size Overflow","description":"### Impact\n\nSQL 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.\n\n### Patches\n\nThe problem is resolved in v4.18.2 and v5.5.4.\n\n### Workarounds\n\nReject user input large enough to cause a single query or bind message to exceed 4 GB in size.\n","status":"published","published":"2024-03-04T20:43:24Z","modified":"2026-09-10T03:50:10.601755576Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"},{"version":"4.0","score":8.1,"vector":"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","level":"high"}],"cwes":["CWE-190","CWE-89"],"updated_at":"2026-11-02T15:46:52.170928Z"},{"id":"UBUNTU-CVE-2024-27304","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.","status":"published","published":"2024-03-06T19:15:00Z","modified":"2026-10-17T12:56:43.5301005Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T16:54:48.333535Z"},{"id":"AZL-35752","title":"CVE-2024-27304 affecting package telegraf for versions less than 1.31.0-1","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.","status":"published","published":"2024-03-06T19:15:08Z","modified":"2026-04-21T04:32:34.516084Z","updated_at":"2026-11-02T15:28:04.173658Z"},{"id":"AZL-35762","title":"CVE-2024-27304 affecting package telegraf for versions less than 1.28.5-5","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.","status":"published","published":"2024-03-06T19:15:08Z","modified":"2026-04-21T04:25:05.231327Z","updated_at":"2026-11-02T15:28:04.173658Z"},{"id":"GO-2024-2606","title":"SQL injection in github.com/jackc/pgproto3 and github.com/jackc/pgx","description":"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.","status":"published","published":"2024-03-14T17:12:43Z","modified":"2026-02-04T03:55:09.802349Z","updated_at":"2026-11-02T15:47:01.185262Z"}]}}
