CVE-2024-32655

Npgsql Vulnerable to SQL Injection via Protocol Message Size Overflow

HIGH
8.1
CVSS Score
Published: May 9, 2024 at 02:29 PM UTC
Updated: June 17, 2026 at 07:30 AM UTC
1 product affected across 1 vendorNpgsql

Using npgsql by npgsql?

Get instant alerts when new vulnerabilities affect npgsql - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH8.1
Exploit prediction
EPSS 2%
SSVC
No known exploit

Description

Npgsql is the .NET data provider for PostgreSQL. The `WriteBind()` method in `src/Npgsql/Internal/NpgsqlConnector.FrontendMessages.cs` uses `int` variables to store the message length and the sum of parameter lengths. Both variables overflow when the sum of parameter lengths becomes too large. This causes Npgsql to write a message size that is too small when constructing a Postgres protocol message to send it over the network to the database. When parsing the message, the database will only read a small number of bytes and treat any following bytes as new messages while they belong to the old message. Attackers can abuse this to inject arbitrary Postgres protocol messages into the connection, leading to the execution of arbitrary SQL statements on the application's behalf. This vulnerability is fixed in 4.0.14, 4.1.13, 5.0.18, 6.0.11, 7.0.7, and 8.0.3.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 4.0.14v < 4.1.13v < 5.0.18v < 6.0.11v < 7.0.7v < 8.0.34.0.0 ≤ v < 4.0.144.1.0 ≤ v < 4.1.135.0.0 ≤ v < 5.0.186.0.0 ≤ v < 6.0.117.0.0 ≤ v < 8.0.38.0.0 ≤ v < 8.0.34.0.04.1.05.0.06.0.07.0.08.0.0
Affected range stops below 4.0.14, so it looks safe — our inference, not a vendor statement
Affected range stops below 4.1.13, so it looks safe — our inference, not a vendor statement
Affected range stops below 5.0.18, so it looks safe — our inference, not a vendor statement
Affected range stops below 6.0.11, so it looks safe — our inference, not a vendor statement
Affected range stops below 7.0.7, so it looks safe — our inference, not a vendor statement
Affected range stops below 8.0.3, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet, and no fixed version or vendor advisory is recorded against it.

SSVC — Action Prioritization

SSVCNo known exploitAutomatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

8.1HIGHGitHub_M
Attack Vector
NETWORK
Complexity
HIGH
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusDEFERRED
CWE
CWE-89CWE-190

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card