Skip to content

CVE-2024-32655 Npgsql Vulnerable to SQL Injection via Protocol Message Size Overflow

HighCVSS 8.1 EPSS 1.7% PoC
Published
Updated
Exploit status
Proof-of-concept only
CISA SSVC
No known exploitation · automatable: yes · technical impact: total
Technology
Ubuntu

Description

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.

Upgrade path

7 packages: 2 fixed, 5 with no fix yet.

PackageAffectedFixed inStatus
ubuntu/npgsql(Ubuntu 16.04) = 2.2.7+dfsg3-1; All versions No fix listed No fix yet
ubuntu/npgsql(Ubuntu 18.04) = 2.2.7+dfsg3-1; All versions No fix listed No fix yet
ubuntu/npgsql(Ubuntu 20.04) = 2.2.7+dfsg3-1; All versions No fix listed No fix yet
ubuntu/npgsql(Ubuntu 22.04) = 2.2.7+dfsg3-1; All versions No fix listed No fix yet
ubuntu/npgsql(Ubuntu 24.04) = 2.2.7+dfsg3-1.1; All versions No fix listed No fix yet
npgsql = >= 4.0.0, < 4.0.14; = >= 4.1.0, < 4.1.13; = >= 5.0.0, < 5.0.18; = >= 6.0.0, < 6.0.11 +8 more 4.0.14, 4.1.13, 5.0.18, 6.0.11, 8.0.3 Fixed
nuget Npgsql(NuGet) < 4.0.14; <= 4.0.13; = 2.0.11; = 2.0.12 +136 more 4.0.14, 4.1.13, 5.0.18, 6.0.11, 7.0.7, 8.0.3 Fixed

Affected products

ProductAffected versionsFixed in
nuget Npgsql(NuGet) >= 8.0.0, < 8.0.3 8.0.3
nuget Npgsql(NuGet) = 8.0.0 No fix listed
nuget Npgsql(NuGet) = 8.0.1 No fix listed
nuget Npgsql(NuGet) = 8.0.2 No fix listed
nuget Npgsql(NuGet) < 4.0.14 4.0.14
nuget Npgsql(NuGet) = 2.0.11 No fix listed
nuget Npgsql(NuGet) = 2.0.12 No fix listed
nuget Npgsql(NuGet) = 2.0.12.1 No fix listed
nuget Npgsql(NuGet) = 2.0.13-beta1 No fix listed
nuget Npgsql(NuGet) = 2.0.14.1 No fix listed
nuget Npgsql(NuGet) = 2.0.14.2 No fix listed
nuget Npgsql(NuGet) = 2.0.14.3 No fix listed
nuget Npgsql(NuGet) = 2.1.0 No fix listed
nuget Npgsql(NuGet) = 2.1.0-beta1 No fix listed
nuget Npgsql(NuGet) = 2.1.0-rc1 No fix listed
nuget Npgsql(NuGet) = 2.1.1 No fix listed
nuget Npgsql(NuGet) = 2.1.2 No fix listed
nuget Npgsql(NuGet) = 2.1.3 No fix listed
nuget Npgsql(NuGet) = 2.2.0 No fix listed
nuget Npgsql(NuGet) = 2.2.0-beta1 No fix listed
nuget Npgsql(NuGet) = 2.2.0-rc1 No fix listed
nuget Npgsql(NuGet) = 2.2.0-rc2 No fix listed
nuget Npgsql(NuGet) = 2.2.1 No fix listed
nuget Npgsql(NuGet) = 2.2.2 No fix listed
nuget Npgsql(NuGet) = 2.2.3 No fix listed
Show 137 more
ProductAffected versionsFixed in
nuget Npgsql(NuGet) = 2.2.4 No fix listed
nuget Npgsql(NuGet) = 2.2.4.1 No fix listed
nuget Npgsql(NuGet) = 2.2.4.2 No fix listed
nuget Npgsql(NuGet) = 2.2.4.3 No fix listed
nuget Npgsql(NuGet) = 2.2.5 No fix listed
nuget Npgsql(NuGet) = 2.2.6 No fix listed
nuget Npgsql(NuGet) = 2.2.7 No fix listed
nuget Npgsql(NuGet) = 3.0.0 No fix listed
nuget Npgsql(NuGet) = 3.0.0-beta0001 No fix listed
nuget Npgsql(NuGet) = 3.0.0-rc0001 No fix listed
nuget Npgsql(NuGet) = 3.0.0-rc0002 No fix listed
nuget Npgsql(NuGet) = 3.0.1 No fix listed
nuget Npgsql(NuGet) = 3.0.2 No fix listed
nuget Npgsql(NuGet) = 3.0.3 No fix listed
nuget Npgsql(NuGet) = 3.0.4 No fix listed
nuget Npgsql(NuGet) = 3.0.5 No fix listed
nuget Npgsql(NuGet) = 3.0.6 No fix listed
nuget Npgsql(NuGet) = 3.0.7 No fix listed
nuget Npgsql(NuGet) = 3.0.8 No fix listed
nuget Npgsql(NuGet) = 3.1.0 No fix listed
nuget Npgsql(NuGet) = 3.1.0-alpha1 No fix listed
nuget Npgsql(NuGet) = 3.1.0-alpha2 No fix listed
nuget Npgsql(NuGet) = 3.1.0-alpha3 No fix listed
nuget Npgsql(NuGet) = 3.1.0-alpha4 No fix listed
nuget Npgsql(NuGet) = 3.1.0-alpha5 No fix listed
nuget Npgsql(NuGet) = 3.1.0-alpha6 No fix listed
nuget Npgsql(NuGet) = 3.1.0-beta0001 No fix listed
nuget Npgsql(NuGet) = 3.1.1 No fix listed
nuget Npgsql(NuGet) = 3.1.10 No fix listed
nuget Npgsql(NuGet) = 3.1.2 No fix listed
nuget Npgsql(NuGet) = 3.1.3 No fix listed
nuget Npgsql(NuGet) = 3.1.4 No fix listed
nuget Npgsql(NuGet) = 3.1.5 No fix listed
nuget Npgsql(NuGet) = 3.1.6 No fix listed
nuget Npgsql(NuGet) = 3.1.7 No fix listed
nuget Npgsql(NuGet) = 3.1.8 No fix listed
nuget Npgsql(NuGet) = 3.1.9 No fix listed
nuget Npgsql(NuGet) = 3.2.0 No fix listed
nuget Npgsql(NuGet) = 3.2.0-beta1 No fix listed
nuget Npgsql(NuGet) = 3.2.1 No fix listed
nuget Npgsql(NuGet) = 3.2.2 No fix listed
nuget Npgsql(NuGet) = 3.2.3 No fix listed
nuget Npgsql(NuGet) = 3.2.4 No fix listed
nuget Npgsql(NuGet) = 3.2.4.1 No fix listed
nuget Npgsql(NuGet) = 3.2.5 No fix listed
nuget Npgsql(NuGet) = 3.2.6 No fix listed
nuget Npgsql(NuGet) = 3.2.7 No fix listed
nuget Npgsql(NuGet) = 4.0.0 No fix listed
nuget Npgsql(NuGet) = 4.0.0-preview1 No fix listed
nuget Npgsql(NuGet) = 4.0.0-preview2 No fix listed
nuget Npgsql(NuGet) = 4.0.0-rc1 No fix listed
nuget Npgsql(NuGet) = 4.0.1 No fix listed
nuget Npgsql(NuGet) = 4.0.10 No fix listed
nuget Npgsql(NuGet) = 4.0.11 No fix listed
nuget Npgsql(NuGet) = 4.0.12 No fix listed
nuget Npgsql(NuGet) = 4.0.13 No fix listed
nuget Npgsql(NuGet) = 4.0.2 No fix listed
nuget Npgsql(NuGet) = 4.0.3 No fix listed
nuget Npgsql(NuGet) = 4.0.4 No fix listed
nuget Npgsql(NuGet) = 4.0.5 No fix listed
nuget Npgsql(NuGet) = 4.0.6 No fix listed
nuget Npgsql(NuGet) = 4.0.7 No fix listed
nuget Npgsql(NuGet) = 4.0.8 No fix listed
nuget Npgsql(NuGet) = 4.0.9 No fix listed
nuget Npgsql(NuGet) >= 4.1.0, < 4.1.13 4.1.13
nuget Npgsql(NuGet) = 4.1.0 No fix listed
nuget Npgsql(NuGet) = 4.1.1 No fix listed
nuget Npgsql(NuGet) = 4.1.10 No fix listed
nuget Npgsql(NuGet) = 4.1.11 No fix listed
nuget Npgsql(NuGet) = 4.1.12 No fix listed
nuget Npgsql(NuGet) = 4.1.2 No fix listed
nuget Npgsql(NuGet) = 4.1.3 No fix listed
nuget Npgsql(NuGet) = 4.1.3.1 No fix listed
nuget Npgsql(NuGet) = 4.1.4 No fix listed
nuget Npgsql(NuGet) = 4.1.5 No fix listed
nuget Npgsql(NuGet) = 4.1.6 No fix listed
nuget Npgsql(NuGet) = 4.1.7 No fix listed
nuget Npgsql(NuGet) = 4.1.8 No fix listed
nuget Npgsql(NuGet) = 4.1.9 No fix listed
nuget Npgsql(NuGet) >= 5.0.0, < 5.0.18 5.0.18
nuget Npgsql(NuGet) = 5.0.0 No fix listed
nuget Npgsql(NuGet) = 5.0.1 No fix listed
nuget Npgsql(NuGet) = 5.0.1.1 No fix listed
nuget Npgsql(NuGet) = 5.0.10 No fix listed
nuget Npgsql(NuGet) = 5.0.11 No fix listed
nuget Npgsql(NuGet) = 5.0.12 No fix listed
nuget Npgsql(NuGet) = 5.0.13 No fix listed
nuget Npgsql(NuGet) = 5.0.14 No fix listed
nuget Npgsql(NuGet) = 5.0.15 No fix listed
nuget Npgsql(NuGet) = 5.0.16 No fix listed
nuget Npgsql(NuGet) = 5.0.17 No fix listed
nuget Npgsql(NuGet) = 5.0.2 No fix listed
nuget Npgsql(NuGet) = 5.0.3 No fix listed
nuget Npgsql(NuGet) = 5.0.4 No fix listed
nuget Npgsql(NuGet) = 5.0.5 No fix listed
nuget Npgsql(NuGet) = 5.0.7 No fix listed
nuget Npgsql(NuGet) >= 6.0.0, < 6.0.11 6.0.11
nuget Npgsql(NuGet) = 6.0.0 No fix listed
nuget Npgsql(NuGet) = 6.0.1 No fix listed
nuget Npgsql(NuGet) = 6.0.10 No fix listed
nuget Npgsql(NuGet) = 6.0.2 No fix listed
nuget Npgsql(NuGet) = 6.0.3 No fix listed
nuget Npgsql(NuGet) = 6.0.4 No fix listed
nuget Npgsql(NuGet) = 6.0.5 No fix listed
nuget Npgsql(NuGet) = 6.0.6 No fix listed
nuget Npgsql(NuGet) = 6.0.7 No fix listed
nuget Npgsql(NuGet) = 6.0.8 No fix listed
nuget Npgsql(NuGet) = 6.0.9 No fix listed
nuget Npgsql(NuGet) >= 7.0.0, < 7.0.7 7.0.7
nuget Npgsql(NuGet) = 7.0.0 No fix listed
nuget Npgsql(NuGet) = 7.0.1 No fix listed
nuget Npgsql(NuGet) = 7.0.2 No fix listed
nuget Npgsql(NuGet) = 7.0.4 No fix listed
nuget Npgsql(NuGet) = 7.0.6 No fix listed
nuget Npgsql(NuGet) <= 4.0.13 No fix listed
ubuntu/npgsql(Ubuntu:22.04) All versions No fix listed
npgsql = >= 4.0.0, < 4.0.14 No fix listed
npgsql = >= 4.1.0, < 4.1.13 No fix listed
npgsql = >= 5.0.0, < 5.0.18 No fix listed
npgsql = >= 6.0.0, < 6.0.11 No fix listed
npgsql = >= 7.0.0, < 7.0.7 No fix listed
npgsql = >= 8.0.0, < 8.0.3 No fix listed
npgsql >= 4.0.0, < 4.0.14 4.0.14
npgsql >= 4.1.0, < 4.1.13 4.1.13
npgsql >= 5.0.0, < 5.0.18 5.0.18
npgsql >= 6.0.0, < 6.0.11 6.0.11
npgsql >= 7.0.0, < 8.0.3 8.0.3
npgsql >= 8.0.0, < 8.0.3 8.0.3
ubuntu/npgsql(Ubuntu:24.04) All versions No fix listed
ubuntu/npgsql(Ubuntu:16.04) All versions No fix listed
ubuntu/npgsql(Ubuntu:16.04) = 2.2.7+dfsg3-1 No fix listed
ubuntu/npgsql(Ubuntu:18.04) All versions No fix listed
ubuntu/npgsql(Ubuntu:18.04) = 2.2.7+dfsg3-1 No fix listed
ubuntu/npgsql(Ubuntu:20.04) All versions No fix listed
ubuntu/npgsql(Ubuntu:20.04) = 2.2.7+dfsg3-1 No fix listed
ubuntu/npgsql(Ubuntu:22.04) = 2.2.7+dfsg3-1 No fix listed
ubuntu/npgsql(Ubuntu:24.04) = 2.2.7+dfsg3-1.1 No fix listed

References