CVE-2023-23626 Denial of service when feeding malformed size arguments in go-bitfield

Medium 5.9 Published Updated

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`.

Weakness: CWE-1284, CWE-754

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.

PackageAffectedFixed in
github.com/ipfs/go-bitfield GoAll versions1.1.0
github.com/ipfs/go-bitfield GoAll versions1.1.0
github.com/ipfs/go-bitfield GoAll versions1.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.

Is CVE-2023-23626 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free