Skip to main content
Public proof of conceptFix available

CVE-2024-1597

A public proof of concept exists; no exploitation attested.

  • Published2024-02-19
  • Fixed in42.7.2 · 42.6.1 · 42.5.5 · 42.4.4 · 42.3.9 · 42.2.28
  • WeaknessCWE-89

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

Description

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.

Timeline

dates in UTC
  1. 2024-02-1913:15CVE publishedNVD

Versions per branch

CISA-ADP · NVD · OSV
Pgjdbc
BranchAffectedFixed in
42.7< 42.7.242.7.2
42.6< 42.6.142.6.1
42.5< 42.5.542.5.5
42.4< 42.4.442.4.4
42.3< 42.3.942.3.9
42.2< 42.2.2842.2.28
Postgresql postgresql jdbc driver
BranchAffectedFixed in
42.7≥ 42.7.0, < 42.7.242.7.2
42.6≥ 42.6.0, < 42.6.142.6.1
42.5≥ 42.5.0, < 42.5.542.5.5
42.4≥ 42.4.0, < 42.4.442.4.4
42.3≥ 42.3.0, < 42.3.942.3.9
42.2< 42.2.2842.2.28
Fedoraproject fedora
BranchAffectedFixed in
40.x= 40no fix published

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA1 product

As PostgreSQL, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • pgjdbc
    Affected
    • = < 42.7.2no fix stated
    • = < 42.6.1no fix stated
    • = < 42.5.5no fix stated
    • = < 42.4.4no fix stated
    • = < 42.3.9no fix stated
    • = < 42.2.28no fix stated

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2024-06-10

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • apache-hiveCleanStartall versions · fixed in 3.1.3-r3
  • dependency-trackWolfiall versions · fixed in 4.10.1-r1and 1 other package
  • dependency-trackChainguardall versions · fixed in 4.10.1-r1and 1 other package
  • io.root.org.postgresql:postgresqlRoot:Mavenall versions · fixed in 42.6.0-root.io.1
  • io.root.org.postgresql:postgresqlRoot:Mavenall versions · fixed in 42.5.1-root.io.1
  • io.root.org.postgresql:postgresqlRoot:Mavenall versions · fixed in 42.5.1-root.io.2
  • io.root.org.postgresql:postgresqlRoot:Mavenall versions · fixed in 42.6.0-root.io.2
  • io.root.org.postgresql:postgresqlRoot:Mavenall versions · fixed in 42.6.0-root.io.3

74 more package ranges on OSV.dev

Vendor advisories

  • CVE-2024-1597 Red Hat Product Security74 products fixed · 10 known affected

    pgjdbc: PostgreSQL JDBC Driver allows attacker to inject SQL if using PreferQueryMode=SIMPLE

    pgjdbc as a component of Red Hat build of Apache Camel 4 for Quarkus 3 · pgjdbc as a component of Red Hat build of Apache Camel for Spring Boot 3 · pgjdbc as a component of Red Hat build of OptaPlanner 8 · +7 more

  • RHSA-2024:5056 Red Hat Product Security1 product fixed

    Red Hat Security Advisory: Red Hat Integration Camel K 1.10.7 release and security update.

  • RHSA-2024:4884 Red Hat Product Security1 product fixed

    Red Hat Security Advisory: Red Hat Build of Apache Camel 4.4.1 for Spring Boot security update.

  • RHSA-2024:4402 Red Hat Product Security9 products fixed

    Red Hat Security Advisory: postgresql-jdbc security update

  • RHSA-2024:4375 Red Hat Product Security9 products fixed

    Red Hat Security Advisory: postgresql-jdbc security update

  • RHSA-2024:4057 Red Hat Product Security26 products fixed

    Red Hat Security Advisory: Release of OpenShift Serverless Logic 1.33.0 security update & enhancements

10 more advisories

Full record on NVD

Fix

  1. Update Pgjdbc to 42.7.2 · 42.6.1 · 42.5.5 · 42.4.4 · 42.3.9 · 42.2.28
  2. Vendor fix Red Hat Product Security RHSA-2024:5056 · 1 productBefore applying this update, make sure all previously released errata relevant to your system have been applied. For details on how to apply this update, refer to: https://access.redhat.com/articles/11258
  3. Vendor fix Red Hat Product Security RHSA-2024:4402 · 9 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
  4. Vendor fix Red Hat Product Security RHSA-2024:4057 · 26 productsSee the Red Hat OpenShift serverless 1.33 documentation at: https://access.redhat.com/documentation/en-us/red_hat_openshift_serverless/1.33
  5. Vendor fix Red Hat Product Security RHBA-2024:2108 · 1 productBefore applying the update, back up your existing installation, including all applications, configuration files, databases and database settings, and so on.
  6. Vendor fix Red Hat Product Security RHSA-2024:1999 · 2 productsBefore applying this update, make sure all previously released errata relevant to your system have been applied. For details on how to apply this update, refer to: https://access.redhat.com/articles/11258 If the postgresql service is running, it will be automatically restarted after installing t…
  7. Vendor fix Red Hat Product Security RHSA-2024:1649 · 2 productsBefore applying this update, make sure all previously released errata relevant to your system have been applied. For details on how to apply this update, refer to: https://access.redhat.com/articles/11258 If the postgresql service is running, it will be automatically restarted after installing t…

Advisories and patches

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

  • CISA-ADPSSVC decisionpoc2024-04-10
  • CNACVSS 3.110known since 2026-10-23
  • NVDCVSS 3.19.8read 2026-10-23
  • CNAweakness (CWE)CWE-89known since 2026-10-23
  • NVDweakness (CWE)CWE-89read 2026-10-23
  • FIRST EPSSEPSS score4.8 %2026-11-08
  • OSVaffected packages—
  • GitHub AdvisoriesadvisoryCRITICAL2024-02-21

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Published
2024-02-19
Last Modified
2026-06-17
NVD status
Modified
GitHub Advisory
GHSA-24rp-q3w6-vc56

Frequently asked questions

What is CVE-2024-1597?

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.

Is CVE-2024-1597 actively exploited?

A proof-of-concept exploit exists for CVE-2024-1597, but active exploitation has not been confirmed at this time.

What is the CVSS score for CVE-2024-1597?

CVE-2024-1597 has a CVSS v3 base score of 9.8 (CRITICAL severity), with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.

Running PostgreSQL? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record