{"id":"CVE-2024-27289","published":"2024-03-06T18:28:12Z","modified":"2025-06-12T15:45:56Z","title":"pgx SQL Injection via Line Comment Creation","vendor":"jackc","product":"pgx","tier":"tail","description":{"text":"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.\n","provenance":"source","from":"CVE.org"},"cvss":{"score":8.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01161,"percentile":0.6698,"provenance":"source"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"references":[{"url":"https://github.com/jackc/pgx/security/advisories/GHSA-m7wr-2xf7-cm9p","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df","tags":["x_refsource_MISC"]},{"url":"https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/","tags":[]}],"priority":{"score":19.1,"factors":[{"name":"EPSS percentile","points":13.4},{"name":"CVSS severity","points":5.67}]},"vendorSlug":"jackc","affectedVersions":[{"vendor":"jackc","product":"pgx","versions":["< 4.18.2"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2024-07-24T14:13:55.313789Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"github.com/jackc/pgx","vulnerableRanges":["<4.18.2","all versions"],"patched":["4.18.2"],"from":["GHSA-m7wr-2xf7-cm9p","GO-2024-2605"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/jackc/pgx/v4","vulnerableRanges":["<4.18.2"],"patched":["4.18.2"],"from":["GHSA-m7wr-2xf7-cm9p","GO-2024-2605"],"provenance":"source"}],"summary":{"text":"The pgx PostgreSQL driver and toolkit for Go has an SQL injection flaw in versions prior to 4.18.2, where a numeric placeholder immediately preceded by a minus sign can cause a second string placeholder on the same line to be injected into the SQL command. An attacker can exploit this over the network without authentication or user interaction, but only when the non-default simple protocol is in use and both parameter values are user-controlled.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:38:23Z"},"euvd":{"id":"EUVD-2024-0962","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-jackc-pgx-cve-2024-27289","children":[{"from":"CVE-2024-27289","to":"CVE-2026-41889","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["internal/sanitize/sanitize.go"],"commits":["https://github.com/jackc/pgx/commit/f94eb0e2f96782042c96801b5ac448f44f0a81df","https://github.com/jackc/pgx/commit/60644f84918a8af66d14a4b0d865d4edafd955da"],"basis":"rarely changed file"},{"kind":"similar","provenance":"machine","score":0.47,"basis":"same product + CWE + description similarity"}]}]}}