CVE-2024-27304CWE-190CWE-89

pgx SQL Injection via Protocol Message Size Overflow

Critical · published March 6, 2024

CVSS v3.1
9.8
EPSS
1%
Percentile
65.6
In the wild
Unconfirmed
What it is

🚨 A single oversized message could bring your PostgreSQL driver crashing down! The pgx driver has a sneaky SQL injection vulnerability that could let attackers break queries into manageable chunks that they control. 🔥 Think of this vulnerability like a delivery service that accepts packages so large they can't fit through the front door. Instead of rejecting the oversized parcel, the service splits it up and delivers the individual pieces, allowing an intruder to manipulate the contents without anyone noticing! An attacker could exploit this vulnerability to execute arbitrary SQL commands, potentially gaining unauthorized access to your database, modifying records, or even deleting data! The consequences could be absolutely devastating for your application's integrity and user trust.

Put simply

Think of this vulnerability like a delivery service that accepts packages so large they can't fit through the front door. Instead of rejecting the oversized parcel, the service splits it up and delivers the individual pieces, allowing an intruder to manipulate the contents without anyone noticing! This SQL injection vulnerability arises when an attacker sends a query exceeding 4 GB, leading to an integer overflow that allows the message to be processed in parts they control. This can manipulate data and execute unintended operations on your database.

What to do

An attacker could exploit this vulnerability to execute arbitrary SQL commands, potentially gaining unauthorized access to your database, modifying records, or even deleting data! The consequences could be absolutely devastating for your application's integrity and user trust. Upgrade your pgx driver to version 4.18.2 or 5.5.4 immediately to patch this vulnerability. Additionally, implement strict input validation to ensure that no queries or bind messages exceed the 4 GB limit. This will help safeguard your application against such attacks. You've got this! With these steps, you'll be locking down your PostgreSQL database in no time! 🛡️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.01109 · 65.6th percentile
Weaknesses
CWE-190 · Integer Overflow or Wraparound; CWE-89 · Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Published
2024-03-06T19:07Z
EPSS history
Timeline
  • 06 MAR 19:07Z
    pgx SQL Injection via Protocol Message Size Overflow
    cvelistv5