CVE-2023-23626 Denial of service when feeding malformed size arguments in go-bitfield
Attackers can cause a denial of service by providing malformed size arguments to go-bitfield functions, triggering panics in applications using the library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-23626?
CVE-2023-23626 is a medium-severity denial of service vulnerability in ipfs go-bitfield, published on 9 Feb 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
go-bitfield is a simple bitfield package for the go language aiming to be more performant that the standard library. When feeding untrusted user input into the size parameter of `NewBitfield` and `FromBytes` functions, an attacker can trigger `panic`s. This happen when the `size` is a not a multiple of `8` or is negative. There were already a note in the `NewBitfield` documentation, however known users of this package are subject to this issue. Users are advised to upgrade. Users unable to upgrade should ensure that `size` is a multiple of 8 before calling `NewBitfield` or `FromBytes`.
Which versions are affected by CVE-2023-23626?
3 open source packages ship an affected version, including github.com/ipfs/go-bitfield. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/ipfs/go-bitfield Go | All versions | 1.1.0 |
github.com/ipfs/go-bitfield Go | All versions | 1.1.0 |
github.com/ipfs/go-bitfield Go | All versions | 1.1.0 |
Products include Protocol Go-Bitfield.
How do I fix CVE-2023-23626?
Upgrade github.com/ipfs/go-bitfield to 1.1.0 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2023-23626 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-23626 exists.
Sources
Also known as GHSA-2h6c-j3gf-xp9r, GO-2023-1558.