CVE-2024-32655 Npgsql Vulnerable to SQL Injection via Protocol Message Size Overflow
- 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.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| 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
| Product | Affected versions | Fixed 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
| Product | Affected versions | Fixed 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
- https://github.com/npgsql/npgsql/security/advisories/GHSA-x9vc-6hfv-hg8c issue-tracking vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- https://github.com/npgsql/npgsql/commit/091655eed0c84e502ab424950c930339d17c1928 patch
- https://github.com/npgsql/npgsql/commit/3183efb2bdcca159c8c2e22af57e18ea8f853cf0 patch
- https://github.com/npgsql/npgsql/commit/67acbe027e28477ac2199e15cfb554bb2ffaf169 patch
- https://github.com/npgsql/npgsql/commit/703d9af8fa48dfe8c0180e36edb8278f34342d7b patch
- https://github.com/npgsql/npgsql/commit/a22a42d8141d7a3528f43c02c095a409507cf1af patch
- https://github.com/npgsql/npgsql/commit/e34e2ba8042e666d9af54a1b255fba4d5b11df56 patch
- https://github.com/npgsql/npgsql/commit/f7e7ead0702d776a8f551f5786c4cac2d65c4bc6 issue-tracking patch
- https://www.youtube.com/watch?v=Tfg1B8u1yvE
- https://github.com/npgsql/npgsql/releases/tag/v8.0.3
- https://github.com/npgsql/npgsql/releases/tag/v7.0.7
- https://github.com/npgsql/npgsql/releases/tag/v6.0.11
- https://github.com/npgsql/npgsql/releases/tag/v5.0.18
- https://github.com/npgsql/npgsql/releases/tag/v4.1.13
- https://github.com/npgsql/npgsql/releases/tag/v4.0.14
- github.com exploit
- github.com
- github.com product
- github.com
- Ubuntu CVE tracker issue-tracking vendor-advisory
- www.cve.org issue-tracking