Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend crafted CRAM file with BYTE_ARRAY_LEN encoding
-
ExploitParser reads unvalidated array size
-
ExecutionBuffer overflow in decode function
-
ImpactCorrupt heap or stack memory
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V15 - Secure Coding and Architecture Stack buffer bounds checking
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Victim must open or process a crafted CRAM file using HTSlib when reading data encoded with the BYTE_ARRAY_LEN method. Requires no authentication. Attack is remote but victim interaction needed to open malicious CRAM bioinformatics file. |
| Impact | This vulnerability presents critical real-world risk despite the absence of a CVSS vector and EPSS score in the available data. The technical impact is severe: the vulnerability enables arbitrary code execution via memory corruption, affecting the control flow of any application using affected HTSlib versions. The attack vector is network/local (via file opening), requires no privileges, and has low complexity since it only requires crafting a malicious CRAM file. The fact that patches exist and have been released in three stable versions (1.23.1, 1.22.2, 1.21.1) indicates vendor acknowledgment of active exploitation risk. HTSlib's use in bioinformatics pipelines, genomics research, and medical data processing increases the risk profile, as compromised systems could lead to data exfiltration or pipeline sabotage. The absence of known public POC or active KEV listing does not diminish the risk; this is a memory safety issue requiring no user interaction beyond opening a file. |
| Exploit ScenarioDerived | A researcher receives a CRAM file from a collaborator (or downloads from a public repository) containing malicious data engineered to trigger the buffer overflow in |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Mar 18, 2026
HTSlib, a widely-used bioinformatics library for reading and writing sequence alignment formats, contains a critical buffer overflow vulnerability in its CRAM format decoder. The vulnerability exists in the cram_byte_array_len_decode() function which fails to validate that unpacked data matches the output buffer size, affecting HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1. An attacker can craft a malicious CRAM file that, when opened by a user, triggers either a heap or stack overflow with attacker-controlled bytes, potentially leading to arbitrary code execution, program crash, or memory corruption.
RemediationAI
Immediately upgrade HTSlib to version 1.23.1, 1.22.2, or 1.21.1 or later depending on your release line, as detailed in the GitHub security advisory at https://github.com/samtools/htslib/security/advisories/GHSA-jvx4-4wq7-6fmh. The upstream patch is available at https://github.com/samtools/htslib/commit/01cd003b46fa2ebea4d9be5475b11217eb4c11be. No workaround exists for this vulnerability; patching is the only mitigation. For applications unable to patch immediately, implement strict input validation by refusing CRAM files from untrusted sources, sandboxing HTSlib-dependent processes using OS-level isolation (containers, seccomp), and monitoring for unexpected process termination or memory access patterns. Verify that all downstream tools and pipelines (samtools, GATK, etc.) are updated to use patched HTSlib versions.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
HTSlib (cpe:2.3:a:samtools:htslib) is a C library providing core functionality for reading and writing bioinformatics file formats including SAM, BAM, and CRAM. CRAM is a compressed sequence alignment format that uses multiple encoding and compression strategies to reduce file size. The vulnerability resides in the BYTE_ARRAY_LEN decoding method within the CRAM decoder, where the cram_byte_array_len_decode() function processes variable-length byte arrays. The root cause is classified under CWE-121 (Stack-based Buffer Overflow) and related heap overflow patterns, stemming from insufficient input validation. The decoder reads a length field and unpacks data without verifying that the actual data size matches the declared size or the allocated buffer capacity, allowing malicious input to write beyond buffer boundaries.
Know when Htslib gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
Lifecycle Timeline
2DescriptionGitHub Advisory
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.
Executive ViewAI
Organizations using HTSlib face moderate risk from CVE-2026-31971, a stack-based buffer overflow vulnerability rated CVSS 7.1. Exploitation could allow attackers to corrupt memory, crash the application, or potentially execute arbitrary code. Organizations should apply vendor updates when available and consider compensating controls in the interim.
Apply vendor patch. If immediate patching is not feasible: (1) Enable ASLR and DEP where available; (2) Implement network segmentation; (3) Monitor for exploitation indicators.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.
A stack-based buffer overflow occurs when a program writes more data to a buffer located on the stack than it was allocated to hold.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Related Vulnerabilities in HTSlib Memory Corruption Vulnerabilities
View all 4An issue has been found in HTSlib 1.8. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no au
samtools htslib library version 1.4.0 and earlier is vulnerable to buffer overflow in the CRAM rANS codec resulting in p
An issue has been found in HTSlib 1.8. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitable, n
HTSlib contains a heap buffer overflow vulnerability in its CRAM decoder caused by an out-by-one error when validating f
HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1 contain a heap buffer overflow vulnerability in the cram_decode_seq(
Stack-based buffer overflow in HTSlib's CRAM decoder affects all releases before 1.21.2, 1.22.3, 1.23.2, and 1.24: a cra
Heap out-of-bounds read and write in HTSlib's experimental CRAM v4 XPACK and XRLE decoders allows a remote, unauthentica
Heap buffer overflow in HTSlib's BCF reader allows an attacker-crafted BCF file to corrupt heap memory when opened by an
In HTSlib 1.8, a race condition in cram/cram_io.c might allow local users to overwrite arbitrary files via a symlink att
An issue has been found in HTSlib 1.8. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no au
Same weakness CWE-121 – Stack-based Buffer Overflow
View allVendor StatusVendor
Debian
| Release | Status | Fixed Version | Urgency |
|---|---|---|---|
| bullseye | vulnerable | 1.11-4 | - |
| bookworm | vulnerable | 1.16+ds-3 | - |
| trixie | vulnerable | 1.21+ds-1 | - |
| forky, sid | vulnerable | 1.22.1+ds2-1 | - |
| (unstable) | fixed | (unfixed) | - |
EUVD-2026-12948
NVD
CVE.org
EPSS
GitHub
VulDB
Exploit-DB