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

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (1.94%). Schedule for your next planned update.

Does your project use an affected Npgsql version?

Paste your packages.lock.json to check it for CVE-2024-32655 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my packages.lock.json

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 (931 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, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (6)

Affects 1 ecosystem: NuGet (1).

PackageFixed In
Npgsql NuGet · Affected: 7.0.0, 7.0.1, 7.0.2, 7.0.4 (+1 more)7.0.7
Npgsql NuGet · Affected: 4.1.0, 4.1.1, 4.1.10, 4.1.11 (+10 more)4.1.13
Npgsql NuGet · Affected: 8.0.0, 8.0.1, 8.0.28.0.3
Npgsql NuGet · Affected: 5.0.0, 5.0.1, 5.0.1.1, 5.0.10 (+12 more)5.0.18
Npgsql NuGet · Affected: 2.0.11, 2.0.12, 2.0.12.1, 2.0.13-beta1 (+80 more)4.0.14
Npgsql NuGet · Affected: 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. It has a 1.9% probability of exploitation within 30 days (EPSS score). 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

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
1.94%
EPSS percentile: 80.8

This places it in the top quartile of EPSS-scored vulnerabilities — 80.8% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.

Also Known As

GHSA-x9vc-6hfv-hg8c

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my packages.lock.json