Impact
An out-by-one error in HTSlib's cram_byte_array_stop_decode_char() function allows the CRAM decoder to write a single byte past the end of a dynamically allocated buffer when processing data encoded with the BYTE_ARRAY_STOP method. This heap buffer overflow can cause the application to crash or corrupt memory and may, in certain circumstances, enable an attacker to execute arbitrary code. The vulnerability is classified as CWE-122 and CWE-787.
Affected Systems
The affected product is HTSLib, used by the Samtools toolkit. Versions 1.23.1, 1.22.2 and 1.21.1 contain the fix, meaning any installation of earlier releases—including 1.23.0 and prior—is vulnerable. The issue is specific to the CRAM decoding component of the library.
Risk and Exploitability
The CVSS score is 7.1, indicating a high severity. The EPSS score is below 1%, suggesting low exploitation probability in the wild, and the vulnerability is not listed in CISA's KEV catalog. Attackers would need to supply a malicious CRAM file that uses the BYTE_ARRAY_STOP encoding to trigger the overflow, which typically requires local access or the ability to influence the data the program reads.
OpenCVE Enrichment