CVE-2024-1597
published 2024-02-19CVE-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…
PriorityP180critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
ITWVulnCheck KEV
Exploited in the wild
EPSS
4.81%
91.0th percentile
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.
Affected
16 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| atlassian | bamboo | — | — |
| atlassian | bamboo_data_center | — | — |
| debian | libpgjava | < libpgjava 42.5.5-0+deb12u1 (bookworm) | libpgjava 42.5.5-0+deb12u1 (bookworm) |
| fedoraproject | fedora | — | — |
| pgjdbc | pgjdbc | < 42.7.2 | 42.7.2 |
| pgjdbc | pgjdbc | < 42.6.1 | 42.6.1 |
| pgjdbc | pgjdbc | < 42.5.5 | 42.5.5 |
| pgjdbc | pgjdbc | < 42.4.4 | 42.4.4 |
| pgjdbc | pgjdbc | < 42.3.9 | 42.3.9 |
| pgjdbc | pgjdbc | < 42.2.28 | 42.2.28 |
| postgresql | postgresql_jdbc_driver | < 42.2.28 | 42.2.28 |
| postgresql | postgresql_jdbc_driver | >= 42.3.0 < 42.3.9 | 42.3.9 |
| postgresql | postgresql_jdbc_driver | >= 42.4.0 < 42.4.4 | 42.4.4 |
| postgresql | postgresql_jdbc_driver | >= 42.5.0 < 42.5.5 | 42.5.5 |
| postgresql | postgresql_jdbc_driver | >= 42.6.0 < 42.6.1 | 42.6.1 |
| postgresql | postgresql_jdbc_driver | >= 42.7.0 < 42.7.2 | 42.7.2 |
Detection & IOCsextracted from sources · hover to see the quote
- →Detect exploitation attempts by monitoring PostgreSQL logs for unexpected SQL commands or logic injected via application connection attempts, such as OR 1=1 patterns ↗
- →Monitor application logs for suspicious connection strings containing SQL injection payloads ↗
- →An abnormal spike in database errors related to syntax may indicate failed injection attempts ↗
- →Audit Java application dependencies for vulnerable pgjdbc versions (before 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, 42.2.28) using Software Composition Analysis (SCA) tools ↗
- →Flag any JDBC connection strings that explicitly set preferQueryMode=simple, as this is the required non-default condition for exploitation ↗
- →Proof-of-concept exploits use crafted usernames such as ' a=1 ; followed by a malicious SQL query to bypass authentication ↗
- ·Vulnerability is only exploitable when the non-default JDBC connection property preferQueryMode=simple is explicitly set; the default mode (extended) is not affected ↗
- ·Exploitation requires a specific SQL structure: a numeric placeholder immediately preceded by a minus sign, followed by a string placeholder on the same line ↗
- ·Red Hat Satellite ships the affected pgjdbc but Candlepin does not set PreferQueryMode, so the product impact is considered Low ↗
CVSS provenance
nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
osv9.8CRITICAL
vulncheck10.0CRITICAL
vendor_debian10.0CRITICAL
vendor_redhat10.0CRITICAL
vendor_oracle9.8CRITICAL
CVEs like this are exactly what “Exploited This Week” covers.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Oracle
Oracle Oracle Fusion Middleware Risk Matrix: Third Party (PostgreSQL JDBC Driver) — CVE-2024-1597
vendor_oracle·2024-04-15·CVSS 9.8
CVE-2024-1597 [CRITICAL] Oracle Oracle Fusion Middleware Risk Matrix: Third Party (PostgreSQL JDBC Driver) — CVE-2024-1597
Oracle Oracle Fusion Middleware Risk Matrix: Third Party (PostgreSQL JDBC Driver) vulnerability
CVE: CVE-2024-1597
CVSS: 9.8
Protocol: HTTP
Remote exploit: Yes
Affected versions: Network
Advisory: cpuapr2024 (APR 2024)
Atlassian
SQLi (SQL Injection) org.postgresql:postgresql Dependency in Bamboo Data Center and Server NOTE : CVE-2024-1597 is a cri
vendor_atlassian·2024-03-19·CVSS 9.5
CVE-2024-1597 [CRITICAL] SQLi (SQL Injection) org.postgresql:postgresql Dependency in Bamboo Data Center and Server NOTE : CVE-2024-1597 is a cri
SQLi (SQL Injection) org.postgresql:postgresql Dependency in Bamboo Data Center and Server NOTE : CVE-2024-1597 is a cri
SQLi (SQL Injection) org.postgresql:postgresql Dependency in Bamboo Data Center and Server NOTE : CVE-2024-1597 is a critical vulnerability in a non-Atlassian Bamboo dependency. However, Atlassian’s application of the dependency presents a lower assessed risk, which is why we are disclosing this vulnerability in our monthly Security Bulletin instead of a Critical Security Advisory.
CVE: CVE-2024-1597
Affected products: Bamboo, Bamboo Data Center
Red Hat
pgjdbc: PostgreSQL JDBC Driver allows attacker to inject SQL if using PreferQueryMode=SIMPLE
vendor_redhat·2024-02-19·CVSS 10.0
CVE-2024-1597 [CRITICAL] CWE-89 pgjdbc: PostgreSQL JDBC Driver allows attacker to inject SQL if using PreferQueryMode=SIMPLE
pgjdbc: PostgreSQL JDBC Driver allows attacker to inject SQL if using PreferQueryMode=SIMPLE
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.
A flaw was found in the PostgreSQL JDBC Driver. A SQL injection is possible wh
Debian
CVE-2024-1597: libpgjava - pgjdbc, the PostgreSQL JDBC Driver, allows attacker to inject SQL if using Prefe...
vendor_debian·2024·CVSS 10.0
CVE-2024-1597 [CRITICAL] CVE-2024-1597: libpgjava - pgjdbc, the PostgreSQL JDBC Driver, allows attacker to inject SQL if using Prefe...
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.
Scope: local
bookworm: resolved (fixed in 42.5.5-0+deb12u1)
bullseye: resolved (fixed in 42.2.15-1+deb11u2)
forky: resolved (fixed in 42.7.2-1)
sid: resolved (fixed in 42.7.
GHSA
org.postgresql:postgresql vulnerable to SQL Injection via line comment generation
ghsa·2024-02-21
CVE-2024-1597 [CRITICAL] CWE-89 org.postgresql:postgresql vulnerable to SQL Injection via line comment generation
org.postgresql:postgresql vulnerable to SQL Injection via line comment generation
# Impact
SQL injection is possible when using the non-default connection property `preferQueryMode=simple` in combination with application code that has a vulnerable SQL that negates a parameter value.
There is no vulnerability in the driver when using the default query mode. Users that do not override the query mode are not impacted.
# Exploitation
To exploit this behavior the following conditions must be met:
1. A placeholder for a numeric value must be immediately preceded by a minus (i.e. `-`)
1. There must be a second placeholder for a string value after the first placeholder on the same line.
1. Both parameters must be user controlled.
The prior behavior of the driver when operating in simple quer
OSV
org.postgresql:postgresql vulnerable to SQL Injection via line comment generation
osv·2024-02-21
CVE-2024-1597 [CRITICAL] org.postgresql:postgresql vulnerable to SQL Injection via line comment generation
org.postgresql:postgresql vulnerable to SQL Injection via line comment generation
# Impact
SQL injection is possible when using the non-default connection property `preferQueryMode=simple` in combination with application code that has a vulnerable SQL that negates a parameter value.
There is no vulnerability in the driver when using the default query mode. Users that do not override the query mode are not impacted.
# Exploitation
To exploit this behavior the following conditions must be met:
1. A placeholder for a numeric value must be immediately preceded by a minus (i.e. `-`)
1. There must be a second placeholder for a string value after the first placeholder on the same line.
1. Both parameters must be user controlled.
The prior behavior of the driver when operating in simple quer
OSV
Duplicate Advisory: SQL injection in pgjdbc
osv·2024-02-19
CVE-2024-1597 [CRITICAL] Duplicate Advisory: SQL injection in pgjdbc
Duplicate Advisory: SQL injection in pgjdbc
## Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-24rp-q3w6-vc56. This link is maintained to preserve external references.
## Original 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,
OSV
CVE-2024-1597: pgjdbc, the PostgreSQL JDBC Driver, allows attacker to inject SQL if using PreferQueryMode=SIMPLE
osv·2024-02-19·CVSS 9.8
CVE-2024-1597 [CRITICAL] CVE-2024-1597: pgjdbc, the PostgreSQL JDBC Driver, allows attacker to inject SQL if using PreferQueryMode=SIMPLE
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.
VulnCheck
postgresql postgresql_jdbc_driver Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
vulncheck·2024·CVSS 10.0
CVE-2024-1597 [CRITICAL] postgresql postgresql_jdbc_driver Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
postgresql postgresql_jdbc_driver Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
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.
Affected: postgresql postgresql_jdbc_driver
Require
No detection rules found.
No public exploits indexed.
Bugzilla
CVE-2024-1597 pgjdbc: PostgreSQL JDBC Driver allows attacker to inject SQL if using PreferQueryMode=SIMPLE
bugzilla·2024-02-28·CVSS 9.8
CVE-2024-1597 [CRITICAL] CVE-2024-1597 pgjdbc: PostgreSQL JDBC Driver allows attacker to inject SQL if using PreferQueryMode=SIMPLE
CVE-2024-1597 pgjdbc: PostgreSQL JDBC Driver allows attacker to inject SQL if using PreferQueryMode=SIMPLE
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.8 are affected.
https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3
Qualys
Oracle Security Updates, April 2024: Critical Patch | Qualys
blogs_qualys·2024-04-17
Oracle Security Updates, April 2024: Critical Patch | Qualys
#### Table of Contents
- Qualys QID Coverage
- Notable Oracle Vulnerabilities Patched
- Discover and Prioritize Vulnerabilities in Vulnerability Management, Detection & Response (VMDR)
- Rapid Response with Patch Management (PM)
Oracle released its second quarterly edition of Critical Patch Update, which contains patches for 441 security vulnerabilities. Some of the vulnerabilities addressed in this update impact more than one product. These patches address vulnerabilities in various product families, including third-party components in Oracle products.
In the second quarterly Oracle Critical Patch Update, Oracle Communications received the highest number of patches, 93, constituting about 21% of the total patches released. Oracle Fusion Middleware and Oracle Financial Services Applicat
Qualys
Oracle Patch Update, April 2024 Security Update Review
blogs_qualys·2024-04-17
Oracle Patch Update, April 2024 Security Update Review
## Table of Contents
Qualys QID Coverage
Notable Oracle Vulnerabilities Patched
Discover and Prioritize Vulnerabilities in Vulnerability Management, Detection & Response (VMDR)
Rapid Response with Patch Management (PM)
Oracle released its second quarterly edition of Critical Patch Update, which contains patches for 441 security vulnerabilities. Some of the vulnerabilities addressed in this update impact more than one product. These patches address vulnerabilities in various product families, including third-party components in Oracle products.
In the second quarterly Oracle Critical Patch Update, Oracle Communications received the highest number of patches, 93, constituting about 21% of the total patches released. Oracle Fusion Middleware and Oracle Financial Services Applications fo
Wiz
CVE-2026-21570 Impact, Exploitability, and Mitigation Steps | Wiz
blogs_wiz·CVSS 8.8
CVE-2026-21570 [HIGH] CVE-2026-21570 Impact, Exploitability, and Mitigation Steps | Wiz
## CVE-2026-21570 :
Bamboo vulnerability analysis and mitigation
This High severity RCE (Remote Code Execution) vulnerability was introduced in versions 9.6.0, 10.0.0, 10.1.0, 10.2.0, 11.0.0, 11.1.0, 12.0.0, and 12.1.0 of Bamboo Data Center.
This RCE (Remote Code Execution) vulnerability, with a CVSS Score of 8.6, allows an authenticated attacker to execute malicious code on the remote system.
Atlassian recommends that Bamboo Data Center customers upgrade to latest version, if you are unable to do so, upgrade your instance to one of the specified supported fixed versions:
Bamboo Data Center 9.6: Upgrade to a release greater than or equal to 9.6.24
Bamboo Data Center 10.2: Upgrade to a release greater than or equal to 10.2.16
Bamboo Data Center 12.1: Upgrade to a release greater than
Huntress
CVE-2024-1597 Vulnerability: Analysis, Detection, Removal | Huntress
blogs_huntress·CVSS 9.8
CVE-2024-1597 [CRITICAL] CVE-2024-1597 Vulnerability: Analysis, Detection, Removal | Huntress
## CVE-2024-1597 Vulnerability
Published: 12/16/2025
Written by: Nadine Rozell
## What is CVE-2024-1597 Vulnerability?
CVE-2024-1597 is a critical SQL injection vulnerability found in the PostgreSQL JDBC (Java Database Connectivity) Driver. This driver is the go-to for Java applications that need to talk to a PostgreSQL database. The vulnerability allows an attacker to inject malicious SQL code when using a specific, non-default connection mode. A successful exploit can lead to authentication bypass and arbitrary code execution on the database server.
## When was it discovered?
The vulnerability was disclosed on February 20, 2024. The PostgreSQL JDBC driver development team released patched versions to address the flaw. The bug affects a less common connection mode, but its severity
http://www.openwall.com/lists/oss-security/2024/04/02/6https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56https://lists.debian.org/debian-lts-announce/2024/05/msg00007.htmlhttps://lists.fedoraproject.org/archives/list/[email protected]/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/https://security.netapp.com/advisory/ntap-20240419-0008/https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/http://www.openwall.com/lists/oss-security/2024/04/02/6https://github.com/pgjdbc/pgjdbc/security/advisories/GHSA-24rp-q3w6-vc56https://lists.debian.org/debian-lts-announce/2024/05/msg00007.htmlhttps://lists.debian.org/debian-lts-announce/2024/12/msg00017.htmlhttps://lists.fedoraproject.org/archives/list/[email protected]/message/TZQTSMESZD2RJ5XBPSXH3TIQVUW5DIUU/https://security.netapp.com/advisory/ntap-20240419-0008/https://www.enterprisedb.com/docs/jdbc_connector/latest/01_jdbc_rel_notes/https://www.enterprisedb.com/docs/security/assessments/cve-2024-1597/https://www.sonarsource.com/blog/double-dash-double-trouble-a-subtle-sql-injection-flaw/
2024-02-19
Published
Exploited in the wild