Loading...
Skip to main content

CVE-2024-32655 — Vulnerability in Npgsql — CVE Details

HIGH

Npgsql vulnerable to SQL Injection via Protocol Message Size Overflow

Published May 9, 2024Updated September 10, 2026Source: osv

Summary

### Summary 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. ### Impact Attackers can issue arbitrary SQL statements to the database on behalf of the application. The final impact depends on the application that uses Npgsql, the data it stores in Postgres, etc.

Advisory Timeline

  • First published May 9, 2024 (886 days ago).
  • Last revised September 10, 2026 — 854 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

NuGet
Update Npgsql to 7.0.7 or later
dotnet add package Npgsql --version 7.0.7
NuGet
Update Npgsql to 4.1.13 or later
dotnet add package Npgsql --version 4.1.13
NuGet
Update Npgsql to 8.0.3 or later
dotnet add package Npgsql --version 8.0.3
NuGet
Update Npgsql to 5.0.18 or later
dotnet add package Npgsql --version 5.0.18
NuGet
Update Npgsql to 4.0.14 or later
dotnet add package Npgsql --version 4.0.14
NuGet
Update Npgsql to 6.0.11 or later
dotnet add package Npgsql --version 6.0.11

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (6)

Affects 1 ecosystem: nuget (1).

PackageEcosystemAffectedFixed In
Npgsql
nuget
7.0.0, 7.0.1, 7.0.2, 7.0.4 (+1 more)7.0.7
Npgsql
nuget
4.1.0, 4.1.1, 4.1.10, 4.1.11 (+10 more)4.1.13
Npgsql
nuget
8.0.0, 8.0.1, 8.0.28.0.3
Npgsql
nuget
5.0.0, 5.0.1, 5.0.1.1, 5.0.10 (+12 more)5.0.18
Npgsql
nuget
2.0.11, 2.0.12, 2.0.12.1, 2.0.13-beta1 (+80 more)4.0.14
Npgsql
nuget
6.0.0, 6.0.1, 6.0.10, 6.0.2 (+7 more)6.0.11

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2024-32655?
Npgsql vulnerable to SQL Injection via Protocol Message Size Overflow This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.1/10).
How do I check if my project is affected by CVE-2024-32655?
CVE-2024-32655 affects Npgsql. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-32655 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.1

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-x9vc-6hfv-hg8c

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies