{"answers":{"affected":"6 open source packages ship an affected version, including github.com/jackc/pgx and github.com/jackc/pgx/v4. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-27289 exists.","fix":"Upgrade github.com/jackc/pgx to 4.18.2 or later.","what":"CVE-2024-27289 is a high-severity 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-27289 and fix it if it is affected.\n\nWhat it is: CVE-2024-27289 is a high-severity 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: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-27289 exists.\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/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- 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-27289/ (Markdown: https://insights.sbomify.com/CVE-2024-27289/index.md)","id":"CVE-2024-27289","markdown":"https://insights.sbomify.com/CVE-2024-27289/index.md","name":"CVE-2024-27289","record":{"aliases":["AZL-35750","AZL-35763","CLEANSTART-2026-DM54086","CLEANSTART-2026-EY15087","DEBIAN-CVE-2024-27289","GHSA-m7wr-2xf7-cm9p","GO-2024-2605","UBUNTU-CVE-2024-27289"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":true,"product_category":"Go PostgreSQL driver","requires_auth":"none","summary":"SQL injection in pgx Go driver allows attackers to manipulate queries when using the non-default simple protocol with specific numeric and string placeholders.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"pgx","vendor":"jackc"}],"cvss":{"score":8.1,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/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"}],"description":"pgx is a PostgreSQL driver and toolkit for Go. Prior to version 4.18.2, SQL injection can occur when all of the following conditions are met: the non-default simple protocol is used; a placeholder for a numeric value must be immediately preceded by a minus; there must be a second placeholder for a string value after the first placeholder; both must be on the same line; and both parameter values must be user-controlled. The problem is resolved in v4.18.2. As a workaround, do not use the simple protocol or do not place a minus directly before a placeholder.","ecosystems":["Go"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"pgx SQL Injection via Line Comment Creation","id":"CVE-2024-27289","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Go","product":null,"products":[],"type":"sql_injection","year":"2024"},"n_packages":6,"n_references":2,"next":{"headline":"Docassemble HTML and javascript injection","id":"CVE-2024-27290"},"packages":[{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgx","purl":"pkg:golang/github.com/jackc/pgx","source":"GO-2024-2605"},{"ecosystem":"Go","fixed":["4.18.2"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgx","purl":null,"source":"GHSA-m7wr-2xf7-cm9p"},{"ecosystem":"Go","fixed":["4.18.2"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgx","purl":"pkg:golang/github.com/jackc/pgx","source":"GHSA-m7wr-2xf7-cm9p"},{"ecosystem":"Go","fixed":["4.18.2"],"introduced":["0"],"last_affected":[],"package":"github.com/jackc/pgx/v4","purl":null,"source":"GHSA-m7wr-2xf7-cm9p"},{"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-m7wr-2xf7-cm9p"},{"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-2605"}],"prev":{"headline":"1Panel open source panel project has an unauthorized vulnerability.","id":"CVE-2024-27288"},"products":["pgx"],"published":"2024-03-06","related":[{"cvss_score":9.8,"headline":"CVE-2026-33815 in github.com/jackc/pgx","id":"CVE-2026-33815","kev_date_added":null,"published":"2026-04-07"},{"cvss_score":9.8,"headline":"CVE-2026-33816 in github.com/jackc/pgx","id":"CVE-2026-33816","kev_date_added":null,"published":"2026-04-07"},{"cvss_score":2.3,"headline":"pgx: SQL Injection via placeholder confusion with dollar quoted string literals","id":"CVE-2026-41889","kev_date_added":null,"published":"2026-05-08"}],"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)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-06-12","vendors":["jackc"]},"summary":"SQL injection in pgx Go driver allows attackers to manipulate queries when using the non-default simple protocol with specific numeric and string placeholders.","url":"https://insights.sbomify.com/CVE-2024-27289/"}