CVE-2024-1597CWE-89

pgjdbc SQL Injection via line comment generation

Critical · published February 19, 2024

CVSS v3.1
10.0
EPSS
5%
Percentile
91.9
In the wild
Unconfirmed
What it is

🚨 A sneaky SQL injection is lurking in the PostgreSQL JDBC Driver, but only if your query settings aren't locked down! 🔥 Think of it like a restaurant where a chef allows diners to write their own recipes. If a dish calls for a numeric measurement followed by a string, a crafty diner can slip in their own secret ingredient that alters the entire meal! An attacker can exploit this vulnerability to inject malicious SQL code, potentially altering the database query and accessing sensitive data. This could lead to unauthorized data manipulation, exposing your application to devastating consequences – a full breach of your database integrity!

Put simply

Think of it like a restaurant where a chef allows diners to write their own recipes. If a dish calls for a numeric measurement followed by a string, a crafty diner can slip in their own secret ingredient that alters the entire meal! This vulnerability arises from the PreferQueryMode=SIMPLE setting, which allows SQL injection if the placeholders in the query are crafted just right. Attackers can manipulate a numeric placeholder, followed by a string, exploiting the relaxed parameterization to bypass security measures.

What to do

An attacker can exploit this vulnerability to inject malicious SQL code, potentially altering the database query and accessing sensitive data. This could lead to unauthorized data manipulation, exposing your application to devastating consequences – a full breach of your database integrity! To protect your application, upgrade to pgjdbc versions 42.7.2, 42.6.1, 42.5.5, 42.4.4, 42.3.9, or 42.2.28 immediately. Additionally, review the usage of PreferQueryMode and ensure your query parameters are securely handled. Regularly audit and test your SQL statements for vulnerabilities! You’ve got this! By following these steps, you’ll fortify your defenses and keep your database safe. 🛡️

The record
Technical detail
CVSS v3.1
10.0 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.04810 · 91.9th percentile
Weakness
CWE-89 · Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Published
2024-02-19T12:58Z
EPSS history
Timeline
  • 19 FEB 12:58Z
    pgjdbc SQL Injection via line comment generation
    cvelistv5