CVE-2026-31971
published high CVSS 4.0 · 7.1HTSlib CRAM decoder vulnerable to buffer overflow
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| samtools | — | htslib< 1.21.1 · >= 1.22, < 1.22.2 · = 1.23 | Affected | Not stated | GitHub_M |
Description
HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data using a variety of encodings and compression methods. When reading data encoded using the `BYTE_ARRAY_LEN` method, the `cram_byte_array_len_decode()` failed to validate that the amount of data being unpacked matched the size of the output buffer where it was to be stored. Depending on the data series being read, this could result either in a heap or a stack overflow with attacker-controlled bytes. Depending on the data stream this could result either in a heap buffer overflow or a stack overflow. If a user opens a file crafted to exploit this issue it could lead to the program crashing, overwriting of data structures on the heap or stack in ways not expected by the program, or changing the control flow of the program. It may be possible to use this to obtain arbitrary code execution. Versions 1.23.1, 1.22.2 and 1.21.1 include fixes for this issue. There is no workaround for this issue.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 7.1 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| samtools | htslib | < 1.21.1 (affected)>= 1.22, < 1.22.2 (affected)= 1.23 (affected) | GitHub_M · cna |
Weaknesses
4- CWE-121 CWE-121: Stack-based Buffer Overflow
- CWE-122 CWE-122: Heap-based Buffer Overflow
- CWE-787 CWE-787: Out-of-bounds Write
- CWE-1284 CWE-1284: Improper Validation of Specified Quantity in Input
References
2Provider assertions
2GitHub_M · cna
HTSlib CRAM decoder vulnerable to buffer overflow
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 68262b2a68e0d8aaa763a865a08224486f2f54f1f04127fcb34e8ad5e12b0f9a
- Ingested
- 23 Sep 2026, 09:09:43 UTC
- Source record
- Official CVE record