CVE-2024-1597

CRITICAL
Published Feb 19, 2024 Modified Nov 3, 2025 CWE-89

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.

CVSS v3.1 Score

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

Weakness Type (CWE)

CWE-89 SQL Injection

Affected Products

Vendor Product
postgresql postgresql_jdbc_driver
postgresql postgresql_jdbc_driver
postgresql postgresql_jdbc_driver
postgresql postgresql_jdbc_driver
postgresql postgresql_jdbc_driver
postgresql postgresql_jdbc_driver
fedoraproject fedora

References

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. It has a CVSS v3.1 base score of 10.0 (CRITICAL).
How severe is CVE-2024-1597? +
CVE-2024-1597 has a CVSS v3.1 score of 10.0 out of 10, rated CRITICAL. This is a critical vulnerability that should be patched immediately.
What products are affected by CVE-2024-1597? +
CVE-2024-1597 affects products from fedoraproject, postgresql, specifically: fedora, postgresql_jdbc_driver. Check the affected products table above for specific version ranges.
How do I check if I'm vulnerable to CVE-2024-1597? +
You can use Secably's free Website Scanner to check your website for known vulnerabilities. For infrastructure scanning, use the Port Scanner to identify exposed services that may be affected. Check the vendor advisories linked above for specific patch and version information.

Related Vulnerabilities

Don't wait for an exploit

Scan your website for vulnerabilities like CVE-2024-1597 — free, no signup required.

Start Free Scan