{"id":"CVE-2024-1597","published":"2024-02-19T12:58:48Z","modified":"2025-11-03T21:52:29Z","title":"pgjdbc SQL Injection via line comment generation","vendor":"pgjdbc","product":"pgjdbc","tier":"core","eol":null,"affectedVersions":[{"vendor":"pgjdbc","product":"pgjdbc","versions":["< 42.7.2","< 42.6.1","< 42.5.5","< 42.4.4","< 42.3.9","< 42.2.28"]}],"workarounds":{"items":["Don't use SimpleQuery mode"],"from":"CVE.org CNA","provenance":"source"},"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2024-04-10T04:00:36.120593Z","from":"CISA ADP","provenance":"source"},"description":{"text":"pgjdbc, the PostgreSQL JDBC Driver, allows attacker to inject SQL if using PreferQueryMode=SIMPLE. Note this is not the default. In the default mode there is no vulnerability. 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. By constructing a matching string payload, the attacker can inject SQL to alter the query,bypassing the protections that parameterized queries bring against SQL Injection attacks. Versions before 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, and 42.2.28 are affected.","provenance":"source","from":"CVE.org"},"summary":{"text":"The pgjdbc PostgreSQL JDBC Driver is vulnerable to SQL injection in its SIMPLE query mode (PreferQueryMode=SIMPLE, which is not the default), where a numeric placeholder directly preceded by a minus sign and a string placeholder following it on the same line can be abused to inject SQL. An unauthenticated remote attacker can exploit this without user interaction by supplying a crafted string payload to an application that uses the affected configuration, bypassing the protection normally provided by parameterized queries.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-21T14:56:21Z"},"cvss":{"score":10,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0481,"percentile":0.92173,"date":"2026-11-21","provenance":"source"},"kev":null,"vulncheckKev":{"dateAdded":"2024-10-30","exploitedFirstSeen":"2024-10-30","ransomware":false,"evidence":[{"url":"https://www.reliaquest.com/blog/5-critical-threat-actors-you-need-to-know-about/","date":"2024-10-30"}],"evidenceTotal":1,"provenance":"source"},"exploited":true,"otx":{"pulseCount":0,"pulses":[],"provenance":"machine"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"references":[{"url":"https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56","tags":[]},{"url":"https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/","tags":[]},{"url":"https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/","tags":[]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/","tags":[]},{"url":"https://security.netapp.com/advisory/ntap-20240419-0008/","tags":[]},{"url":"http://www.openwall.com/lists/oss-security/2024/04/02/6","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html","tags":[]},{"url":"https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2024/12/msg00017.html","tags":[]}],"techniques":[],"reports":[],"affected":[{"ecosystem":"Maven","package":"org.postgresql:postgresql","vulnerableRanges":["<42.2.28",">=42.3.0, <42.3.9",">=42.4.0, <42.4.4",">=42.5.0, <42.5.5",">=42.6.0, <42.6.1",">=42.7.0, <42.7.2"],"patched":["42.2.28","42.3.9","42.4.4","42.5.5","42.6.1","42.7.2"],"from":["GHSA-24rp-q3w6-vc56"],"provenance":"source"}],"advisories":[{"id":"GHSA-24rp-q3w6-vc56","url":"https://github.com/advisories/GHSA-24rp-q3w6-vc56","severity":"CRITICAL","ecosystem":"Maven","package":"org.postgresql:postgresql","vulnerableRanges":["<42.2.28"],"patched":["42.2.28"],"provenance":"source","from":"GHSA"},{"id":"GHSA-24rp-q3w6-vc56","url":"https://github.com/advisories/GHSA-24rp-q3w6-vc56","severity":"CRITICAL","ecosystem":"Maven","package":"org.postgresql:postgresql","vulnerableRanges":[">=42.3.0, <42.3.9"],"patched":["42.3.9"],"provenance":"source","from":"GHSA"},{"id":"GHSA-24rp-q3w6-vc56","url":"https://github.com/advisories/GHSA-24rp-q3w6-vc56","severity":"CRITICAL","ecosystem":"Maven","package":"org.postgresql:postgresql","vulnerableRanges":[">=42.4.0, <42.4.4"],"patched":["42.4.4"],"provenance":"source","from":"GHSA"},{"id":"GHSA-24rp-q3w6-vc56","url":"https://github.com/advisories/GHSA-24rp-q3w6-vc56","severity":"CRITICAL","ecosystem":"Maven","package":"org.postgresql:postgresql","vulnerableRanges":[">=42.5.0, <42.5.5"],"patched":["42.5.5"],"provenance":"source","from":"GHSA"},{"id":"GHSA-24rp-q3w6-vc56","url":"https://github.com/advisories/GHSA-24rp-q3w6-vc56","severity":"CRITICAL","ecosystem":"Maven","package":"org.postgresql:postgresql","vulnerableRanges":[">=42.6.0, <42.6.1"],"patched":["42.6.1"],"provenance":"source","from":"GHSA"},{"id":"GHSA-24rp-q3w6-vc56","url":"https://github.com/advisories/GHSA-24rp-q3w6-vc56","severity":"CRITICAL","ecosystem":"Maven","package":"org.postgresql:postgresql","vulnerableRanges":[">=42.7.0, <42.7.2"],"patched":["42.7.2"],"provenance":"source","from":"GHSA"}],"euvd":{"id":"EUVD-2024-0465","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2024-0465","exploited":false,"exploitedSince":null,"provenance":"source"},"exploits":[],"exploitSources":null,"exploitRefs":[],"flow":[],"timeline":[{"date":"2024-02-19","kind":"published","label":"Published (CVE.org)","url":"https://www.cve.org/CVERecord?id=CVE-2024-1597","provenance":"source"},{"date":"2024-10-30","kind":"exploited-reported","label":"Exploitation first reported (VulnCheck KEV evidence)","url":"https://www.reliaquest.com/blog/5-critical-threat-actors-you-need-to-know-about/","provenance":"source"}],"speed":{"daysToPublicExploit":null,"firstExploitFrom":null,"daysToKev":null},"priority":{"score":60.4,"factors":[{"name":"In a KEV catalog","points":35.0,"detail":"listed in VulnCheck KEV"},{"name":"Recent KEV listing","points":0.0,"detail":"added 752 days ago"},{"name":"Known ransomware use","points":0.0,"detail":"not known"},{"name":"EPSS percentile","points":18.43,"detail":"percentile 0.9217"},{"name":"Named in threat reports","points":0.0,"detail":"0 reports"},{"name":"Public exploit code","points":0.0,"detail":"none found"},{"name":"Mentioned in OTX pulses","points":0.0,"detail":"0 pulses"},{"name":"CVSS severity","points":7.0,"detail":"base score 10"},{"name":"End-of-life product","points":0.0,"detail":"supported or unknown"}]},"lineage":{"familyId":"fam-pgjdbc-cve-2024-1597","children":[{"from":"CVE-2024-1597","to":"CVE-2024-32888","relation":"related","confidence":"high","kind":"lineage","evidence":[{"kind":"osv-related","provenance":"source","id":"GHSA-24rp-q3w6-vc56","via":"related"},{"kind":"osv-related","provenance":"source","id":"GHSA-x3wm-hffr-chwm","via":"reference","url":"https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56"}]}],"packageHistory":[{"cve":"CVE-2022-26520","published":"2022-03-07","fixed":"42.3.3","kev":false},{"cve":"CVE-2022-31197","published":"2022-08-03","fixed":"42.4.1","kev":false},{"cve":"CVE-2022-41946","published":"2022-11-23","fixed":"42.5.1","kev":false,"link":{"from":"CVE-2022-41946","to":"CVE-2024-1597","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.postgresql:postgresql","fromFixed":"42.2.27","toFixed":"42.2.28","daysApart":453}]}},{"cve":"CVE-2024-1597","published":"2024-02-19","fixed":"42.7.2","kev":false},{"cve":"CVE-2025-49146","published":"2025-06-11","fixed":"42.7.7","kev":false},{"cve":"CVE-2026-42198","published":"2026-04-29","fixed":"42.7.11","kev":false},{"cve":"CVE-2026-54291","published":"2026-07-06","fixed":"42.7.12","kev":false}],"package":"Maven:org.postgresql:postgresql"}}