Every CVE Search/ Get API key

CVE-2024-32655

Npgsql Vulnerable to SQL Injection via Protocol Message Size Overflow

8.1 HighFix available

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

1.72%Up 1.7 points since May 10, 2024
90%50%10%1%

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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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

Affected packages
PackageAffectedFixed
Npgsql
NuGet
8.0.0 up to 8.0.3
8.0.3
Npgsql
NuGet
through 4.0.13
4.0.14
Npgsql
NuGet
4.1.0 up to 4.1.13
4.1.13
Npgsql
NuGet
5.0.0 up to 5.0.18
5.0.18
Npgsql
NuGet
6.0.0 up to 6.0.11
6.0.11
Npgsql
NuGet
7.0.0 up to 7.0.7
7.0.7
Npgsql
NuGet
8.0.0 up to 8.0.3, plus listed versions
8.0.18.0.2
8.0.3
Npgsql
NuGet
before 4.0.14, plus listed versions
2.0.112.0.122.0.12.12.0.13-beta12.0.14.1
Show 45 moreShow less
2.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
Npgsql
NuGet
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 less
4.1.34.1.3.14.1.44.1.54.1.64.1.74.1.84.1.9
4.1.13
Npgsql
NuGet
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 less
5.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
Affected packages
PackageAffectedFixed
Npgsql
NuGet
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 less
6.0.56.0.66.0.76.0.86.0.9
6.0.11
Npgsql
NuGet
7.0.0 up to 7.0.7, plus listed versions
7.0.17.0.27.0.47.0.6
7.0.7
npgsql
Ubuntu:16.04:LTS
All versions, plus listed versions
2.2.7+dfsg3-1
None known
npgsql
Ubuntu:18.04:LTS
All versions, plus listed versions
2.2.7+dfsg3-1
None known
npgsql
Ubuntu:20.04:LTS
All versions, plus listed versions
2.2.7+dfsg3-1
None known
npgsql
Ubuntu:22.04:LTS
All versions, plus listed versions
2.2.7+dfsg3-1
None known
npgsql
Ubuntu:24.04:LTS
All versions, plus listed versions
2.2.7+dfsg3-1.1
None known

History

History
RecordedChangedSources
aliases, publishedEUVD
first indexedCVE 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

Show 17 moreShow less
This page doesn't list everything

Left out here: 34 versions. The JSON record has them.

MoveEnter Open