Impact
HTSlib is a bioinformatics library that reads and writes CRAM files. The vulnerability resides in cram_byte_array_len_decode() when decoding data serialized with the BYTE_ARRAY_LEN method. The function fails to validate that the amount of data being unpacked matches the size of the output buffer, allowing an attacker to supply crafted CRAM data that causes either a heap or a stack overflow. This overflow can corrupt program data structures or hijack control flow, potentially leading to arbitrary code execution. The weakness is a classic buffer overflow (CWE‑121, CWE‑122, CWE‑787, CWE‑1284) and may be exploited by any user who opens a malicious file.
Affected Systems
The issue affects the samtools/htslib library on versions prior to 1.23.1, 1.22.2, and 1.21.1. Versions listed in the KNOWN_CPES or the vendor patch notes indicate that these releases include the fix. Any deployment that uses these libraries to process CRAM files is therefore affected, especially in bioinformatics pipelines that open untrusted data.
Risk and Exploitability
The CVSS base score is 7.1, indicating a moderate to high severity. The EPSS score is less than 1%, suggesting a low probability of current exploitation, and the vulnerability is not listed in the CISA KEV catalog. Nevertheless, because the flaw can lead to remote code execution on the host that runs the library, it is considered a critical risk for systems that ingest untrusted CRAM files. An attacker would need to supply a malicious CRAM file to the vulnerable parser; no additional privileges are required for the attacker to trigger the overflow.
OpenCVE Enrichment