Home / pgjdbc / pgjdbc / CVE-2024-1597
CVE-2024-1597: is it exploited, and which versions of pgjdbc are affected and fixed?
CVE-2024-1597 is a SQL injection vulnerability in pgjdbc. It is not known to be exploited: it is not in CISA's Known Exploited Vulnerabilities catalog (catalog 2026.11.30, read December 3, 2026, 11:38 UTC). Affected: org.postgresql:postgresql before 42.2.28, org.postgresql:postgresql from 42.3.0 before 42.3.9, org.postgresql:postgresql from 42.4.0 before 42.4.4 and 3 more (GitHub advisory GHSA-24rp-q3w6-vc56). Fixed in 42.2.28, 42.3.9, 42.4.4, 42.5.5 and 2 more (GitHub advisory GHSA-24rp-q3w6-vc56). Severity: Critical (10.0, CVSS 3.1, from PostgreSQL).
Data checked December 3, 2026: last read CISA KEV December 3, 2026, 11:38 UTC, CVE record November 19, 2026, 07:12 UTC and NVD November 19, 2026, 07:32 UTC.
What is CVE-2024-1597?
pgjdbc SQL Injection via line comment generation
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.
From the CVE record by PostgreSQL, last updated November 3, 2025, 21:52 UTC.
Which versions are affected, and which fix it?
| Vendor | Product | Affected | Fixed or not affected from |
|---|---|---|---|
| pgjdbc | pgjdbc | < 42.7.2 < 42.6.1 < 42.5.5 < 42.4.4 < 42.3.9 < 42.2.28 |
As the CVE record by PostgreSQL states it, last updated November 3, 2025. Version ranges are the CNA's; a version the record calls not affected is usually the fix.
Which packages are affected, and in which version is each fixed?
| Ecosystem | Package | Affected | Fixed in | Advisory |
|---|---|---|---|---|
| Maven | org.postgresql:postgresql | < 42.2.28 | 42.2.28 | GHSA-24rp-q3w6-vc56 |
| Maven | org.postgresql:postgresql | >= 42.3.0, < 42.3.9 | 42.3.9 | GHSA-24rp-q3w6-vc56 |
| Maven | org.postgresql:postgresql | >= 42.4.0, < 42.4.4 | 42.4.4 | GHSA-24rp-q3w6-vc56 |
| Maven | org.postgresql:postgresql | >= 42.5.0, < 42.5.5 | 42.5.5 | GHSA-24rp-q3w6-vc56 |
| Maven | org.postgresql:postgresql | >= 42.6.0, < 42.6.1 | 42.6.1 | GHSA-24rp-q3w6-vc56 |
| Maven | org.postgresql:postgresql | >= 42.7.0, < 42.7.2 | 42.7.2 | GHSA-24rp-q3w6-vc56 |
GitHub Advisory Database, reviewed advisories (CC BY 4.0); advisory updated February 21, 2024. Summary: org.postgresql:postgresql vulnerable to SQL Injection via line comment generation.
Which products and versions does the NVD list as affected?
| Vendor | Product | Versions | Type |
|---|---|---|---|
| postgresql | postgresql jdbc driver | before 42.2.28 | application |
| postgresql | postgresql jdbc driver | from 42.3.0 before 42.3.9 | application |
| postgresql | postgresql jdbc driver | from 42.4.0 before 42.4.4 | application |
| postgresql | postgresql jdbc driver | from 42.5.0 before 42.5.5 | application |
| postgresql | postgresql jdbc driver | from 42.6.0 before 42.6.1 | application |
| postgresql | postgresql jdbc driver | from 42.7.0 before 42.7.2 | application |
| fedoraproject | fedora | 40 | operating system |
NVD analysis (status Modified), last modified June 17, 2026, 07:04 UTC.
How severe is CVE-2024-1597?
| Score | Version | Vector | Source |
|---|---|---|---|
| Critical 10.0 | CVSS 3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H | PostgreSQL |
| Critical 9.8 | CVSS 3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | NVD |
Each score is shown as its source gave it: the CNA that wrote the record, CISA's ADP (vulnrichment) and the NVD. They can differ.
What the ratings mean: in CVSS 3 and 4, scores run from 0 to 10, with Low 0.1 to 3.9, Medium 4.0 to 6.9, High 7.0 to 8.9 and Critical 9.0 to 10.0. CVSS 2 has no Critical band: its High runs from 7.0 to 10.0. The vector lists how the flaw is reached (network, local), what an attacker needs (privileges, a user's click) and what it can harm.
Is CVE-2024-1597 exploited in the wild?
- CISA KEV
- Not listed (catalog 2026.11.30)
- CISA SSVC
- Exploitation: poc; automatable: yes; technical impact: total (CISA ADP, April 10, 2024)
- EPSS
- 4.81% probability of exploitation activity in the next 30 days, percentile 92.2 (FIRST EPSS, scores of December 2, 2026)
What kind of flaw is it?
- CWE-89 Improper Neutralization of Special Elements used in an SQL Command
Is there a workaround? (from the CVE record)
Don't use SimpleQuery mode
Where are the vendor advisories and references?
- https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56
- https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/
- https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/
- https://lists.fedoraproject.org/archives/list/[email protected]/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/
- https://security.netapp.com/advisory/ntap-20240419-0008/
- http://www.openwall.com/lists/oss-security/2024/04/02/6
- https://lists.debian.org/debian-lts-announce/2024/05/msg00007.html
- https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/
- https://lists.debian.org/debian-lts-announce/2024/12/msg00017.html
Who found and reported it?
- The pgjdbc project thanks Paul Gerste for reporting this problem. (finder)
As published in the CVE record; contact details are removed.
When was it published, and where is the official record?
- Reserved
- February 16, 2024
- Published
- February 19, 2024, 12:58 UTC
- CVE record updated
- November 3, 2025, 21:52 UTC by PostgreSQL
- NVD
- Modified, last modified June 17, 2026, 07:04 UTC
- Last checked
- CVE list November 19, 2026, 07:12 UTC; NVD November 19, 2026, 07:32 UTC; KEV December 3, 2026, 11:38 UTC; EPSS December 2, 2026
- Official record
- cve.org · NVD
What other CVEs affect pgjdbc?
- Nov 23, 2026CVE-2026-134847 pgjdbc: numeric Truncation Error
- Nov 23, 2026CVE-2026-134848 pgjdbc: improper Neutralization of Null Byte or NUL Character
- Nov 23, 2026CVE-2026-134846 pgjdbc: authentication bypass by replay
- Nov 23, 2026CVE-2026-134844 pgjdbc: uncontrolled search path (DLL or library hijacking)
- Nov 23, 2026CVE-2026-134845 pgjdbc: improper certificate validation
- Nov 23, 2026CVE-2026-134843 pgjdbc: exceptional condition mishandled
- Nov 23, 2026CVE-2026-134841 pgjdbc: SQL injection
- Nov 23, 2026CVE-2026-134842 pgjdbc: SQL injection
Questions about CVE-2024-1597
Is CVE-2024-1597 exploited in the wild?
Not as far as CISA knows: it is not in the Known Exploited Vulnerabilities catalog, read December 3, 2026, 11:38 UTC. FIRST's EPSS gives it a 4.81% chance of exploitation activity in the next 30 days (scores of December 2, 2026).
Which versions of pgjdbc are affected by CVE-2024-1597?
org.postgresql:postgresql before 42.2.28, org.postgresql:postgresql from 42.3.0 before 42.3.9, org.postgresql:postgresql from 42.4.0 before 42.4.4, org.postgresql:postgresql from 42.5.0 before 42.5.5, org.postgresql:postgresql from 42.6.0 before 42.6.1 and org.postgresql:postgresql from 42.7.0 before 42.7.2, per the GitHub advisory GHSA-24rp-q3w6-vc56. The tables above give every range the sources list.
Which version fixes CVE-2024-1597?
42.2.28, 42.3.9, 42.4.4, 42.5.5, 42.6.1 and 42.7.2, per the GitHub advisory GHSA-24rp-q3w6-vc56. Check the vendor's advisory before you rely on it.
How severe is CVE-2024-1597?
Critical (10.0, CVSS 3.1, from PostgreSQL). The severity table above shows each score with its source.
Where is the official record of CVE-2024-1597?
The CVE Program's record is at cve.org and the NVD's at nvd.nist.gov. For a fix, the vendor's own advisory is the one to follow.