{"answers":{"affected":"16 open source packages ship an affected version, including github.com/jackc/pgx, github.com/jackc/pgproto3 and github.com/jackc/pgproto3/v2. It affects 2 products.","exploited":"There is no known exploitation of CVE-2024-27304 in the wild and no public exploit code.","fix":"Upgrade github.com/jackc/pgx to a fixed version for your release line: 4.18.2 or 5.5.4.","what":"CVE-2024-27304 is a critical SQL injection vulnerability in jackc pgx, published on 6 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-27304 and fix it if it is affected.\n\nWhat it is: CVE-2024-27304 is a critical SQL injection vulnerability in jackc pgx, published on 6 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-27304 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/jackc/pgx (Go): affected all versions; no fix listed\n- github.com/jackc/pgx (Go): affected all versions; fixed in 4.18.2\n- github.com/jackc/pgx (Go): affected all versions; fixed in 4.18.2\n- github.com/jackc/pgx (Go): affected from 5.0.0; fixed in 5.5.4\n- github.com/jackc/pgx (Go): affected from 5.0.0; fixed in 5.5.4\n- github.com/jackc/pgproto3 (Go): affected all versions; fixed in 2.3.3\n- github.com/jackc/pgproto3 (Go): affected all versions; fixed in 2.3.3\n- github.com/jackc/pgproto3/v2 (Go): affected all versions; fixed in 2.3.3\n- github.com/jackc/pgproto3/v2 (Go): affected all versions; fixed in 2.3.3\n- github.com/jackc/pgproto3/v2 (Go): affected all versions; fixed in 2.3.3\n- github.com/jackc/pgx/v4 (Go): affected all versions; fixed in 4.18.2\n- github.com/jackc/pgx/v4 (Go): affected all versions; fixed in 4.18.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-27304/ (Markdown: https://insights.sbomify.com/CVE-2024-27304/index.md)","id":"CVE-2024-27304","markdown":"https://insights.sbomify.com/CVE-2024-27304/index.md","name":"CVE-2024-27304","record":{"aliases":["AZL-35752","AZL-35762","CLEANSTART-2026-LT14460","CLEANSTART-2026-VJ98970","DEBIAN-CVE-2024-27304","GHSA-7jwh-3vrq-q3m8","GHSA-mrww-27vc-gghv","GO-2024-2606","UBUNTU-CVE-2024-27304"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"Go PostgreSQL driver","requires_auth":"none","summary":"An integer overflow in the pgx Go driver allows attackers to inject SQL by sending oversized messages, potentially leading to unauthorized database access or modification.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"pgproto3","vendor":"jackc"},{"product":"pgx","vendor":"jackc"}],"cvss":{"score":9.8,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"},{"id":"CWE-190","name":"Integer Overflow or Wraparound"}],"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.","ecosystems":["Go"],"exploits":{"exploitdb":0,"first_seen":"2025-10-12","github_poc":1,"max_poc_stars":1,"metasploit":0,"nuclei":0,"refs":[{"date":"2025-10-12T12:56:02Z","kind":"github_poc","ref":"https://github.com/roaris/CVE-2024-27304-PoC","stars":1,"title":"PoC of \"DEF CON 32 - SQL Injection Isn't Dead Smuggling Queries at the Protocol Level - Paul Gerste\""}],"tier":"poc_unverified"},"has_fix":true,"headline":"pgx SQL Injection via Protocol Message Size Overflow","id":"CVE-2024-27304","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Go","product":null,"products":[],"type":"sql_injection","year":"2024"},"n_packages":16,"n_references":7,"next":{"headline":"SMTP smuggling in aiosmtpd","id":"CVE-2024-27305"},"packages":[{"ecosystem":"Go","fixed":["2.3.3"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgproto3","purl":null,"source":"GHSA-7jwh-3vrq-q3m8"},{"ecosystem":"Go","fixed":["2.3.3"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgproto3","purl":"pkg:golang/github.com/jackc/pgproto3","source":"GHSA-7jwh-3vrq-q3m8"},{"ecosystem":"Go","fixed":["2.3.3"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgproto3/v2","purl":null,"source":"GHSA-7jwh-3vrq-q3m8"},{"ecosystem":"Go","fixed":["2.3.3"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgproto3/v2","purl":"pkg:golang/github.com/jackc/pgproto3/v2","source":"GHSA-7jwh-3vrq-q3m8"},{"ecosystem":"Go","fixed":["2.3.3"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgproto3/v2","purl":"pkg:golang/github.com/jackc/pgproto3/v2","source":"GO-2024-2606"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgx","purl":"pkg:golang/github.com/jackc/pgx","source":"GO-2024-2606"},{"ecosystem":"Go","fixed":["4.18.2"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgx","purl":null,"source":"GHSA-mrww-27vc-gghv"},{"ecosystem":"Go","fixed":["4.18.2"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgx","purl":"pkg:golang/github.com/jackc/pgx","source":"GHSA-mrww-27vc-gghv"},{"ecosystem":"Go","fixed":["5.5.4"],"introduced":["5.0.0"],"last_affected":[],"package":"github.com/jackc/pgx","purl":null,"source":"GHSA-mrww-27vc-gghv"},{"ecosystem":"Go","fixed":["5.5.4"],"introduced":["5.0.0"],"last_affected":[],"package":"github.com/jackc/pgx","purl":"pkg:golang/github.com/jackc/pgx","source":"GHSA-mrww-27vc-gghv"},{"ecosystem":"Go","fixed":["4.18.2"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgx/v4","purl":null,"source":"GHSA-mrww-27vc-gghv"},{"ecosystem":"Go","fixed":["4.18.2"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgx/v4","purl":"pkg:golang/github.com/jackc/pgx/v4","source":"GHSA-mrww-27vc-gghv"},{"ecosystem":"Go","fixed":["4.18.2"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgx/v4","purl":"pkg:golang/github.com/jackc/pgx/v4","source":"GO-2024-2606"},{"ecosystem":"Go","fixed":["5.5.4"],"introduced":["5.0.0"],"last_affected":[],"package":"github.com/jackc/pgx/v5","purl":null,"source":"GHSA-mrww-27vc-gghv"},{"ecosystem":"Go","fixed":["5.5.4"],"introduced":["5.0.0"],"last_affected":[],"package":"github.com/jackc/pgx/v5","purl":"pkg:golang/github.com/jackc/pgx/v5","source":"GHSA-mrww-27vc-gghv"},{"ecosystem":"Go","fixed":["5.5.4"],"introduced":["5.0.0"],"last_affected":[],"package":"github.com/jackc/pgx/v5","purl":"pkg:golang/github.com/jackc/pgx/v5","source":"GO-2024-2606"}],"prev":{"headline":"electron-builder's NSIS installer - execute arbitrary code on the target machine (Windows only)","id":"CVE-2024-27303"},"products":["pgx"],"published":"2024-03-06","related":[{"cvss_score":7.5,"headline":"Denial of service in github.com/jackc/pgproto3/v2","id":"CVE-2026-32286","kev_date_added":null,"published":"2026-03-26"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-12-12","vendors":["jackc"]},"summary":"An integer overflow in the pgx Go driver allows attackers to inject SQL by sending oversized messages, potentially leading to unauthorized database access or modification.","url":"https://insights.sbomify.com/CVE-2024-27304/"}