Skip to content
Noroxi
NVD / CVE Program· CNA PostgreSQL

CVE-2024-1597: pgjdbc SQL Injection via line comment generation

Noroxi assessment

Priority: Plan (action score 40/100)

  • The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
  • Probability of exploitation in the next 30 days: 4.8% (FIRST EPSS); higher than 91.9% of all records.
  • Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. No special conditions are required; it is repeatable.
  • According to CISA the attack is automatable: targets can be found by mass scanning.
  • Fixed version: postgresql-jdbc (AlmaLinux:8) 42.2.14-3.el8_9; postgresql-jdbc-javadoc (AlmaLinux:8) 42.2.14-3.el8_9; postgresql-jdbc (AlmaLinux:9) 42.2.28-1.el9_3.

Add it to your regular patch cycle. Upgrade to postgresql-jdbc (AlmaLinux:8) 42.2.14-3.el8_9; postgresql-jdbc-javadoc (AlmaLinux:8) 42.2.14-3.el8_9; postgresql-jdbc (AlmaLinux:9) 42.2.28-1.el9_3 or later.

Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it

Primary sources: NVD · CVE.org · FIRST EPSS

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.

CriticalCVSS 9.8 · v3.1—No exploit Fix available
Published
Feb 19, 2024
Updated
Jun 17, 2026
EPSS
4.8% · 91th percentile

Report tools

JSON

Action score

40

Plan

Add it to your regular patch cycle.

CVSS
39 / 40 · 9.8 / 10
CISA KEV
0 / 30 · Not listed
EPSS
1 / 30 · 4.8%

CISA SSVC decision

Exploitation
proof of concept
Automatable
yes
Technical impact
total

Vulnrichment: CISA's decision-tree inputs.

CNA vs NVD score

NVD
9.8
CNA · PostgreSQL
10.0
0.2 point gap

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.

Get told when this record changes

  • Not in KEV: no record of exploitation in the wild
  • No public exploit code on record
  • A fix has been released

If any of these changes, we'll tell you in the daily email digest.

Follow CVE-2024-1597

When you'll hear from us

  • when it enters CISA KEV
  • when exploit code appears or is weaponized
  • when the record is updated (including a fixed version)
  • when EPSS rises 20 points in a week

One daily email digest (06:00 UTC); connect a webhook for KEV listings and weaponized exploits instantly.

Your free account also gets you

Running WordPress? Scan your site free with WP Lens

  • Stack alerts: add the products and versions you run, get the new CVEs that affect them
  • Uptime monitoring: 1 site, instant email when it goes down
  • Add your domain: subdomains and takeover risk scanned every week (1 domain)
  • 10 scans an hour on the security tools (3 a day without an account), an API key and MCP
  • All your scans in one panel: findings, what changed in the last scan, a report per domain or per client (PDF, share link)
All free tools

Sign up with email · Have an account? Sign in

Free account, no card. Unfollow any time.

Running WordPress? Scan your site free with WP Lens

Is your version affected? Check it

Noroxi analysis

What does it mean in your environment?

The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.

We use this product, ask for help

Affected systems

Is your version affected?

Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.

VendorProduct
postgresqlpostgresql jdbc driver
fedoraprojectfedora

Affected versions

NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.

  • fedoraproject fedora40
  • postgresql postgresql jdbc driver42.3.0 and later · before 42.3.9
  • postgresql postgresql jdbc driver42.4.0 and later · before 42.4.4
  • postgresql postgresql jdbc driverbefore 42.2.28
  • postgresql postgresql jdbc driver42.6.0 and later · before 42.6.1
  • postgresql postgresql jdbc driver42.7.0 and later · before 42.7.2
  • postgresql postgresql jdbc driver42.5.0 and later · before 42.5.5

Versions reported by the vendor

Affected version ranges reported by the assigning authority (PostgreSQL). Independent of NVD's CPE analysis and usually ahead of it.

  • pgjdbc pgjdbc

    • < 42.7.2, < 42.6.1, < 42.5.5, < 42.4.4, < 42.3.9, < 42.2.28affected

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
AlmaLinux:8postgresql-jdbcbefore 42.2.14-3.el8_942.2.14-3.el8_9
AlmaLinux:8postgresql-jdbc-javadocbefore 42.2.14-3.el8_942.2.14-3.el8_9
AlmaLinux:9postgresql-jdbcbefore 42.2.28-1.el9_342.2.28-1.el9_3
Debian:10libpgjavabefore 42.2.5-2+deb10u442.2.5-2+deb10u4
Debian:11libpgjavabefore 42.2.15-1+deb11u242.2.15-1+deb11u2
Debian:12libpgjavabefore 42.5.5-0+deb12u142.5.5-0+deb12u1
Debian:13libpgjavabefore 42.7.2-142.7.2-1
Mavenorg.postgresql:postgresqlfrom 42.3.0 · before 42.3.942.3.9
Mavenorg.postgresql:postgresqlfrom 42.4.0 · before 42.4.442.4.4
Mavenorg.postgresql:postgresqlfrom 42.5.0 · before 42.5.542.5.5
Mavenorg.postgresql:postgresqlfrom 42.6.0 · before 42.6.142.6.1
Mavenorg.postgresql:postgresqlfrom 42.7.0 · before 42.7.242.7.2
Mavenorg.postgresql:postgresqlbefore 42.2.2842.2.28
openSUSE:Leap 15.5postgresql-jdbcbefore 42.2.25-150400.3.12.142.2.25-150400.3.12.1
Red Hat:enterprise_linux:8::appstreampostgresql-jdbcbefore 0:42.2.14-3.el8_90:42.2.14-3.el8_9
Red Hat:enterprise_linux:8::appstreampostgresql-jdbc-javadocbefore 0:42.2.14-3.el8_90:42.2.14-3.el8_9
Red Hat:enterprise_linux:9::appstreampostgresql-jdbcbefore 0:42.2.28-1.el9_30:42.2.28-1.el9_3
Red Hat:rhel_aus:8.2::appstreampostgresql-jdbcbefore 0:42.2.3-5.el8_20:42.2.3-5.el8_2
Red Hat:rhel_aus:8.2::appstreampostgresql-jdbc-javadocbefore 0:42.2.3-5.el8_20:42.2.3-5.el8_2
Red Hat:rhel_aus:8.4::appstreampostgresql-jdbcbefore 0:42.2.3-7.el8_40:42.2.3-7.el8_4
Red Hat:rhel_aus:8.4::appstreampostgresql-jdbc-javadocbefore 0:42.2.3-7.el8_40:42.2.3-7.el8_4
Red Hat:rhel_aus:8.6::appstreampostgresql-jdbcbefore 0:42.2.3-5.el8_60:42.2.3-5.el8_6
Red Hat:rhel_aus:8.6::appstreampostgresql-jdbc-javadocbefore 0:42.2.3-5.el8_60:42.2.3-5.el8_6
Red Hat:rhel_eus:8.8::appstreampostgresql-jdbcbefore 0:42.2.14-5.el8_80:42.2.14-5.el8_8

+8

Other highest-scoring records for the same primary product.

  • CVE-2022-26520In pgjdbc before 42.3.3, an attacker (who controls the jdbc URL or properties) can call java.util.logging.FileHandler to write to arbitrary
    40Plan
  • CVE-2022-21724Unchecked Class Instantiation when providing Plugin Classes
    40Plan
  • CVE-2022-31197SQL Injection in ResultSet.refreshRow() with malicious column names in pgjdbc
    33Monitor

Published before and after this one in the same product

  • ← EarlierCVE-2020-13692Jun 4, 2020 · PostgreSQL JDBC Driver (aka PgJDBC) before 42.2.13 allows XXE.
    31Monitor
  • ← EarlierCVE-2022-41946Nov 23, 2022 · TemporaryFolder on unix-like systems does not limit access to created files in pgjdbc
    22Monitor
  • Later →CVE-2025-49146Jun 11, 2025 · pgjdbc Client Allows Fallback to Insecure Authentication Despite channelBinding=require Configuration
    23Monitor

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
almalinux:postgresql-jdbc42.2.14-3.el8_9 · AlmaLinux:8Package registry (OSV)
almalinux:postgresql-jdbc-javadoc42.2.14-3.el8_9 · AlmaLinux:8Package registry (OSV)
debian:libpgjava42.5.5-0+deb12u1 · Debian:12Package registry (OSV)
Maven:org.postgresql:postgresql42.2.28Package registry (OSV)
Maven:org.postgresql:postgresql42.3.9Package registry (OSV)
Maven:org.postgresql:postgresql42.4.4Package registry (OSV)
Maven:org.postgresql:postgresql42.5.5Package registry (OSV)
Maven:org.postgresql:postgresql42.6.1Package registry (OSV)
Maven:org.postgresql:postgresql42.7.2Package registry (OSV)
opensuse:postgresql-jdbc42.2.25-150400.3.12.1 · openSUSE:Leap 15.5Package registry (OSV)
red hat:postgresql-jdbc0:42.2.14-3.el8_9 · Red Hat:enterprise_linux:8::appstreamPackage registry (OSV)
red hat:postgresql-jdbc-javadoc0:42.2.14-3.el8_9 · Red Hat:enterprise_linux:8::appstreamPackage registry (OSV)
rocky linux:postgresql-jdbc0:42.2.14-3.el8_9 · Rocky Linux:8Package registry (OSV)
suse:postgresql-jdbc42.2.25-150300.3.14.1 · SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSSPackage registry (OSV)
suse:postgresql-jdbc42.2.25-150400.3.12.1 · SUSE:Linux Enterprise Module for Server Applications 15 SP5Package registry (OSV)

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

EPSS, last 120 days

FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

No commit or PR link among the references.

Finders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.

Variant candidates

Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.

No nightly-computed relations.

Chain candidates

An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.

—

Bug bounty scope

No known public program.

Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).

Technical details

Attack conditions

  • Anyone who can reach it over the internet can trigger it.
  • No account or password is required.
  • No user action is required.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
high · data can be read
Integrity
high · data or configuration can be modified
Availability
high · the service can be disrupted
Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality impact
High
Integrity impact
High
Availability impact
High

CVSS vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

nvd-primary

Root cause

The query text is built by concatenating user input. The database cannot tell where the data ends and the command begins.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

ts
const owner = req.query.owner;const rows = await db.query(  "SELECT * FROM files WHERE owner = '" + owner + "'");

Fixed

ts
const owner = req.query.owner;const rows = await db.query(  "SELECT * FROM files WHERE owner = $1",  [owner]);

Change log

  1. Fix✗ → ✓

For records you follow, these changes also arrive as notifications. →

References

All records