CVE-2024-32655
Npgsql Vulnerable to SQL Injection via Protocol Message Size Overflow
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.1
Npgsql Vulnerable to SQL Injection via Protocol Message Size Overflow
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.
- Record
CVE-2024-32655- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-190, CWE-89
- Updated
- 2026-11-02
EUVDEUVD-2024-1856
8.1
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.
- Record
EUVD-2024-1856- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-x9vc-6hfv-hg8c
8.1
Npgsql vulnerable to SQL Injection via Protocol Message Size Overflow
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.
- Record
GHSA-x9vc-6hfv-hg8c- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-89, CWE-190
- Updated
- 2026-11-02
NVD
8.1
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.
- Record
CVE-2024-32655- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-89, CWE-190
- Updated
- 2026-11-02
OSV
8.1
Npgsql Vulnerable to SQL Injection via Protocol Message Size Overflow
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.
- Record
CVE-2024-32655- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-190, CWE-89
- Updated
- 2026-11-02
OSVGHSA-x9vc-6hfv-hg8c
8.1
Npgsql vulnerable to SQL Injection via Protocol Message Size Overflow
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.
- Record
GHSA-x9vc-6hfv-hg8c- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-190, CWE-89
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2024-32655
8.1
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.
- Record
UBUNTU-CVE-2024-32655- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
NpgsqlNuGet |
8.0.0 up to 8.0.3 | 8.0.3 |
NpgsqlNuGet |
through 4.0.13 | 4.0.14 |
NpgsqlNuGet |
4.1.0 up to 4.1.13 | 4.1.13 |
NpgsqlNuGet |
5.0.0 up to 5.0.18 | 5.0.18 |
NpgsqlNuGet |
6.0.0 up to 6.0.11 | 6.0.11 |
NpgsqlNuGet |
7.0.0 up to 7.0.7 | 7.0.7 |
NpgsqlNuGet |
8.0.0 up to 8.0.3, plus listed versions 8.0.18.0.2 |
8.0.3 |
NpgsqlNuGet |
before 4.0.14, plus listed versions 2.0.112.0.122.0.12.12.0.13-beta12.0.14.1 Show 45 moreShow less2.0.14.22.0.14.32.1.02.1.0-beta12.1.0-rc12.1.12.1.22.1.32.2.02.2.0-beta12.2.0-rc12.2.0-rc22.2.12.2.22.2.32.2.42.2.4.12.2.4.22.2.4.32.2.52.2.62.2.73.0.03.0.0-beta00013.0.0-rc00013.0.0-rc00023.0.13.0.23.0.33.0.43.0.53.0.63.0.73.0.83.1.03.1.0-alpha13.1.0-alpha23.1.0-alpha33.1.0-alpha43.1.0-alpha53.1.0-alpha63.1.0-beta00013.1.13.1.103.1.2 |
4.0.14 |
NpgsqlNuGet |
4.1.0 up to 4.1.13, plus listed versions 4.1.14.1.104.1.114.1.124.1.2 Show 8 moreShow less4.1.34.1.3.14.1.44.1.54.1.64.1.74.1.84.1.9 |
4.1.13 |
NpgsqlNuGet |
5.0.0 up to 5.0.18, plus listed versions 5.0.15.0.1.15.0.105.0.115.0.12 Show 10 moreShow less5.0.135.0.145.0.155.0.165.0.175.0.25.0.35.0.45.0.55.0.7 |
5.0.18 |
Show 7 moreShow less
| Package | Affected | Fixed |
|---|---|---|
NpgsqlNuGet |
6.0.0 up to 6.0.11, plus listed versions 6.0.16.0.106.0.26.0.36.0.4 Show 5 moreShow less6.0.56.0.66.0.76.0.86.0.9 |
6.0.11 |
NpgsqlNuGet |
7.0.0 up to 7.0.7, plus listed versions 7.0.17.0.27.0.47.0.6 |
7.0.7 |
npgsqlUbuntu:16.04:LTS |
All versions, plus listed versions 2.2.7+dfsg3-1 |
None known |
npgsqlUbuntu:18.04:LTS |
All versions, plus listed versions 2.2.7+dfsg3-1 |
None known |
npgsqlUbuntu:20.04:LTS |
All versions, plus listed versions 2.2.7+dfsg3-1 |
None known |
npgsqlUbuntu:22.04:LTS |
All versions, plus listed versions 2.2.7+dfsg3-1 |
None known |
npgsqlUbuntu:24.04:LTS |
All versions, plus listed versions 2.2.7+dfsg3-1.1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-32655 is a high vulnerability (CVSS 8.1) in Npgsql, published May 9, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.72%, the 77th percentile. Fixed in Npgsql 8.0.3.
References
github.com/npgsql/npgsql/security/advisories/GHSA-x9vc-6hfv-hg8c
github.com/npgsql/npgsql/commit/091655eed0c84e502ab424950c930339d17c1928
github.com/npgsql/npgsql/commit/3183efb2bdcca159c8c2e22af57e18ea8f853cf0
github.com/npgsql/npgsql/commit/67acbe027e28477ac2199e15cfb554bb2ffaf169
github.com/npgsql/npgsql/commit/703d9af8fa48dfe8c0180e36edb8278f34342d7b
github.com/npgsql/npgsql/commit/a22a42d8141d7a3528f43c02c095a409507cf1af
Show 17 moreShow less
github.com/npgsql/npgsql/commit/e34e2ba8042e666d9af54a1b255fba4d5b11df56
github.com/npgsql/npgsql/commit/f7e7ead0702d776a8f551f5786c4cac2d65c4bc6
github.com/npgsql/npgsql/releases/tag/v4.0.14
github.com/npgsql/npgsql/releases/tag/v4.1.13
github.com/npgsql/npgsql/releases/tag/v5.0.18
github.com/npgsql/npgsql/releases/tag/v6.0.11
github.com/npgsql/npgsql/releases/tag/v7.0.7
github.com/npgsql/npgsql/releases/tag/v8.0.3
youtube.com/watch?v=Tfg1B8u1yvE
github.com/npgsql/npgsql/files/14309386/Npgsql.Security.Advisory.pdf
github.com/npgsql/npgsql/files/14309397/npgsql-protocol-overflow-poc.zip
nvd.nist.gov/vuln/detail/CVE-2024-32655
github.com/advisories/GHSA-x9vc-6hfv-hg8c
github.com/CVEProject/cvelistV5/tree/main/cves/2024/32xxx/CVE-2024-32655.json
github.com/npgsql/npgsql
ubuntu.com/security/CVE-2024-32655
cve.org/CVERecord?id=CVE-2024-32655
Left out here: 34 versions. The JSON record has them.