Raw vector
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:XSummary
CVE-2026-31971 is a high-severity Stack-based Buffer Overflow (CWE-121) vulnerability in Htslib Htslib. Its CVSS base score is 7.1 (High).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked at the 26th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.
The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.
Deeper analysis AI-assisted summary
Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.
HTSlib, a C library for reading and writing high-throughput sequencing data formats including CRAM, is affected by CVE-2026-31971, published on 2026-03-18. The vulnerability occurs in the cram_byte_array_len_decode() function when processing data encoded with the BYTE_ARRAY_LEN method in CRAM files, which store compressed DNA sequence alignment data. This function fails to validate that the unpacked data size matches the output buffer, resulting in either a heap buffer overflow or stack overflow using attacker-controlled bytes. The issue is rated 8.1 on the CVSS 3.1 scale (AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H) and maps to CWEs 121 (stack-based buffer overflow), 122 (heap-based buffer overflow), 787 (out-of-bounds write), and 1284 (buffer underwrite).
Exploitation requires an attacker to craft a malicious CRAM file and convince a user to open it in an application linked to a vulnerable HTSlib version, such as bioinformatics tools processing sequencing data. No privileges are needed (PR:N), and attacks can originate remotely (AV:N) with low complexity (AC:L), though user interaction is required (UI:R). Outcomes include program crashes, unexpected overwriting of heap or stack data structures, control flow hijacking, or potential arbitrary code execution, with high impacts on integrity and availability but no confidentiality loss.
Mitigation is available via patches in HTSlib versions 1.23.1, 1.22.2, and 1.21.1; no workaround exists. The GitHub security advisory (GHSA-jvx4-4wq7-6fmh) and fixing commit (01cd003b46fa2ebea4d9be5475b11217eb4c11be) provide full details on the changes. Security practitioners should prioritize updating affected bioinformatics pipelines and scanning for vulnerable HTSlib instances.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2026-12948
Vulnerability Data
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()`…
more
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.
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise Techniques
CVEs Like This One
Affected Assets
Mitigating Controls
Control response
—
—
- 2 hardening rules · 2 OS baselines
V6.7.2V1.4.1V1.4.2V2.1.1
Mitigating Controls (NIST 800-53 r5) AI
Developer testing and analysis can discover stack-buffer overflows before deployment.
Input validation directly stops untrusted data from exceeding stack buffer bounds.
Memory-protection mechanisms limit the ability to execute injected code after a stack overflow.
Requiring documented secure-development standards and tools can mandate bounds-checked coding practices that avoid the weakness.
Secure-engineering principles include bounds-checked coding and safe buffer handling that avoid introducing the flaw.
Mitigating Controls (NIST CSF 2.0) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.
Secure-development practices directly require bounds checking and safe memory handling that prevent heap overflows.
Vulnerability scanning can discover stack buffer overflows but does not prevent their introduction.
Patching eliminates known instances of the weakness after discovery.
Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.
Security testing (fuzzing, static analysis) detects stack overflows before release.
Secure SDLC mandates buffer-safety practices that directly prevent stack overflows.
Application security requirements can specify buffer-size and input-validation rules.
Secure architecture principles include memory-safety and least-privilege stack usage.
Secure coding standards explicitly forbid unsafe buffer handling that causes CWE-121.
Change management can enforce review gates that catch unsafe memory operations before deployment.
Hardening callouts derived
Configuration rules from DISA STIG baselines that bear on weaknesses of the type cited by this CVE. Each rule is shown with the relationship its mapping actually records, against the CWE it was authored against. Derived via CVE→CWE over `controls_xwalks` (authoritative rows only; rows rated `none` are excluded).
Oracle Linux 8 (1 rule)
- V-248594 OL 8 must implement address space layout randomization (ASLR) to protect its memory from unauthorized code execution. prevents CWE-121
Oracle Linux 9 (1 rule)
- V-271452 OL 9 must use a Linux Security Module configured to enforce limits on system services. prevents CWE-121