PT-2023-19086 · Unknown · Go-Bitfield

Jorropo

·

Published

2023-02-09

·

Updated

2023-02-17

·

CVE-2023-23626

CVSS v3.1

5.9

Medium

VectorAV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Name of the Vulnerable Software and Affected Versions go-bitfield (affected versions not specified)
Description The issue arises when untrusted user input is fed into the size parameter of NewBitfield and FromBytes functions, allowing an attacker to trigger panics. This occurs when the size is not a multiple of 8 or is negative. Although there was a note in the NewBitfield documentation, it was incomplete and missing from FromBytes's documentation. The problem has been addressed by returning an error if the size is incorrect.
Recommendations To resolve the issue, users are advised to upgrade to a version where the NewBitfield and FromBytes functions return an error if the size is not a multiple of 8 or is negative. For users unable to upgrade, ensure that size is a multiple of 8 and not negative before calling NewBitfield or FromBytes. As a temporary workaround, consider checking the condition size%8 == 0 && size >= 0 yourself before calling NewBitfield or FromBytes.

Exploit

Fix

Improper Check for Exceptional Conditions

Weakness Enumeration

Related Identifiers

CVE-2023-23626
GHSA-2H6C-J3GF-XP9R
GO-2023-1558

Affected Products

Go-Bitfield