Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend malformed CRAM file to HTSlib parser
-
ExploitTrigger incorrect sequence decoding in cram_decode_seq()
-
ExecutionRead single byte beyond buffer bounds
-
ImpactLeak sensitive memory or corrupt data structures
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V15 - Secure Coding and Architecture Heap 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 | Remote unauthenticated attacker can exploit by providing a malicious CRAM file (bioinformatics format) to any application using HTSlib that processes CRAM alignment records without sequence/quality data. No user interaction required beyond file processing. |
| Impact | This vulnerability presents moderate-to-high real-world risk despite the absence of a publicly disclosed CVSS vector or EPSS score. The attack vector is local (file-based) with low complexity—an attacker merely crafts a malicious CRAM file and waits for a victim to process it using affected HTSlib versions. No special privileges or user interaction beyond opening a file is required. The technical impact is severe: a single-byte heap overflow can corrupt critical heap metadata (e.g., heap chunk headers, function pointers), potentially enabling code execution, though exploitation requires precise heap state knowledge. HTSlib is used in mission-critical genomics research and clinical variant-calling pipelines; compromise could affect data integrity and confidentiality. The existence of confirmed patches in three active release branches (1.23.1, 1.22.2, 1.21.1) indicates the vendor treats this as high-severity. The lack of a known public POC or KEV listing suggests limited active exploitation to date, but this is likely due to the specialized nature of the target audience (bioinformaticians) rather than difficulty of exploitation. Organizations dependent on HTSlib should prioritize patching. |
| Exploit ScenarioDerived | A researcher downloads what appears to be a legitimate CRAM-formatted genomics dataset from a public repository or receives one via email collaboration. The file contains specially crafted CRAM records with omitted sequence data designed to trigger improper bounds handling in cram_decode_seq(). When the researcher opens this file with a bioinformatics tool (e.g., samtools) linked against vulnerable HTSlib, the library reads one byte beyond a heap allocation and writes attacker-controlled data to that location. Depending on heap layout, this could overwrite a function pointer, heap metadata, or adjacent data structure, leading to denial of service (crash) or potential code execution within the researcher's privileges. No public POC has been disclosed, but the attack requires only file-level access with no network interaction. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Mar 18, 2026
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() function when processing CRAM-formatted bioinformatics files with omitted sequence and quality data. An attacker can craft a malicious CRAM file that triggers an out-of-bounds read followed by an attacker-controlled single-byte write to heap memory, potentially enabling arbitrary code execution, data corruption, or denial of service when a user opens the file. No public exploit proof-of-concept has been identified, but the vulnerability is confirmed and patched by the HTSlib project.
RemediationAI
Immediately upgrade HTSlib to version 1.23.1, 1.22.2, or 1.21.1 depending on your active release branch (see https://github.com/samtools/htslib/security/advisories/GHSA-xxmp-v7h3-gpwp for details). The fix has been implemented in commit d799b54c6401879187bba4741be83ff590ac73e3 and addresses the incorrect data consumption logic in cram_decode_seq(). If immediate patching is not feasible, restrict file input to CRAM files from trusted, verified sources and implement file integrity validation (e.g., cryptographic signatures) at ingestion points in your bioinformatics pipeline. Avoid processing CRAM files from untrusted or internet-sourced repositories until patching is complete. No functional workaround exists that does not involve disabling CRAM format support or upgrading HTSlib.
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 is a C library for reading and writing bioinformatics file formats including SAM, BAM, and CRAM. CRAM is a compressed sequence alignment format that optimizes storage by allowing alignment records to omit DNA sequence and quality value data in certain contexts. However, the CRAM specification requires that even omitted data be present in the file stream and must be consumed and discarded during parsing. The vulnerability exists in the cram_decode_seq() function (CWE-122: Heap-based Buffer Overflow), where improper handling of these omitted-but-present data fields causes a single-byte read beyond allocated heap bounds, followed by a write of attacker-controlled data to that same out-of-bounds location. HTSlib is widely used in genomics pipelines and research workflows (CPE: cpe:2.3:a:samtools:htslib:*:*:*:*:*:*:*:*).
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:N/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N
Primary rating from GitHub Advisory.
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. While most alignment records store DNA sequence and quality values, the format also allows them to omit this data in certain cases to save space. Due to some quirks of the CRAM format, it is necessary to handle these records carefully as they will actually store data that needs to be consumed and then discarded. Unfortunately the cram_decode_seq() did not handle this correctly in some cases. Where this happened it could result in reading a single byte from beyond the end of a heap allocation, followed by writing a single attacker-controlled byte to the same location. Exploiting this bug causes a heap buffer overflow. If a user opens a file crafted to exploit this issue, it could lead to the program crashing, or overwriting of data and heap structures in ways not expected by 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 significant risk from CVE-2026-31962, a heap-based buffer overflow vulnerability rated CVSS 8.8. 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.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
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 CRAM Format Buffer Overflow
View all 3An 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 buffer overflow vulnerability in its CRAM format decoder affecting the VARINT and CONST encoding handl
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
HTSlib, a widely-used bioinformatics library for reading and writing sequence alignment formats, contains a critical buf
HTSlib versions prior to 1.21.1, 1.22.2, and 1.23.1 contain an out-by-one error in the CRAM decoder's `cram_byte_array_s
Same weakness CWE-122 – Heap-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-12923
NVD
CVE.org
EPSS
GitHub
VulDB
Exploit-DB