CVE-2024-32655 — Vulnerability in Npgsql — CVE Details
Npgsql vulnerable to SQL Injection via Protocol Message Size Overflow
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.
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.
dotnet add package Npgsql --version 7.0.7
dotnet add package Npgsql --version 4.1.13
dotnet add package Npgsql --version 8.0.3
dotnet add package Npgsql --version 5.0.18
dotnet add package Npgsql --version 4.0.14
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).
| Package | Fixed 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.2 | 8.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.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
References
- https://github.com/npgsql/npgsql/security/advisories/GHSA-x9vc-6hfv-hg8cWEB
- https://nvd.nist.gov/vuln/detail/CVE-2024-32655ADVISORY
- https://github.com/npgsql/npgsql/commit/091655eed0c84e502ab424950c930339d17c1928WEB
- https://github.com/npgsql/npgsql/commit/3183efb2bdcca159c8c2e22af57e18ea8f853cf0WEB
- https://github.com/npgsql/npgsql/commit/67acbe027e28477ac2199e15cfb554bb2ffaf169WEB
- https://github.com/npgsql/npgsql/commit/703d9af8fa48dfe8c0180e36edb8278f34342d7bWEB
- https://github.com/npgsql/npgsql/commit/a22a42d8141d7a3528f43c02c095a409507cf1afWEB
- https://github.com/npgsql/npgsql/commit/e34e2ba8042e666d9af54a1b255fba4d5b11df56WEB
- https://github.com/npgsql/npgsql/commit/f7e7ead0702d776a8f551f5786c4cac2d65c4bc6WEB
- https://www.youtube.com/watch?v=Tfg1B8u1yvEWEB
- https://github.com/npgsql/npgsql/releases/tag/v8.0.3WEB
- https://github.com/npgsql/npgsql/releases/tag/v7.0.7WEB
- https://github.com/npgsql/npgsql/releases/tag/v6.0.11WEB
- https://github.com/npgsql/npgsql/releases/tag/v5.0.18WEB
- https://github.com/npgsql/npgsql/releases/tag/v4.1.13WEB
- https://github.com/npgsql/npgsql/releases/tag/v4.0.14WEB
- https://github.com/npgsql/npgsql/files/14309397/npgsql-protocol-overflow-poc.zipWEB
- https://github.com/npgsql/npgsql/files/14309386/Npgsql.Security.Advisory.pdfWEB
- https://github.com/npgsql/npgsqlPACKAGE
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
Significant impact if exploited, or exploitable with modest effort.
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
Related CVEs
- CVE-2026-102529HIGH
HtmlSanitizer: CSS Removal DoS
- CVE-2026-63184HIGH
Refitter: Unrestricted OpenAPI references permit build-host SSRF and file inclusion