Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend malformed CRAM file with invalid VARINT encoding
-
ExploitBypass context validation in HTSlib parser
-
ExecutionWrite beyond heap buffer boundaries
-
ImpactCorrupt adjacent memory structures
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 | Remote attacker sends a crafted CRAM format bioinformatics file with malformed VARINT or CONST encodings to an application using HTSlib library. No authentication, user interaction, or special configuration required. Vulnerability exists in default HTSlib CRAM decoder implementations. |
| Impact | This vulnerability presents significant real-world risk despite the absence of a CVSS score in the provided data. The technical impact is severe: the vulnerability enables both heap buffer overflow and stack buffer overflow with potential for arbitrary code execution, positioning it as a high-severity finding. Attack complexity appears relatively low given that exploitation requires only a crafted file input, with no special privileges or user interaction beyond opening the file. The attack vector is network/local depending on how HTSlib is deployed (web service, command-line tool, or library). While no CVSS vector is provided, the descriptor indicates potential for RCE and data structure corruption. The existence of patched versions (1.23.1, 1.22.2, 1.21.1) suggests vendor acknowledgment of exploitability. Given that bioinformatics tools often process untrusted data files from public repositories and that HTSlib is a foundational library in genomics pipelines, the automatable nature of file-based exploitation and the widespread use of this library across research institutions elevates real-world risk considerably. This is not a low-priority finding despite the absence of known public POC or active KEV listing. |
| Exploit ScenarioDerived | An attacker crafts a malicious CRAM file with specially-constructed VARINT or CONST encoded blocks that violate expected context constraints, then hosts the file on a public genomics repository or shares it directly with a researcher. When a scientist downloads and opens the file using a bioinformatics tool built on vulnerable HTSlib (such as SAMtools or a genomics pipeline), the decoder attempts to write decoded values without properly validating buffer boundaries, causing an 8-byte write beyond the heap allocation or corrupting an adjacent stack variable. Depending on the memory layout and overwritten values, this could immediately crash the application or subtly corrupt program state to enable arbitrary code execution on the researcher's system. No special privileges are required; the attack requires only that the victim open the file. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Mar 18, 2026
HTSlib contains a buffer overflow vulnerability in its CRAM format decoder affecting the VARINT and CONST encoding handlers, where incomplete context validation allows writes of up to eight bytes beyond heap allocation boundaries or into stack-allocated single-byte variables. This vulnerability affects HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1, and impacts any application using the library to process CRAM-formatted bioinformatics data files. An attacker can craft a malicious CRAM file to trigger heap or stack overflow conditions, potentially leading to denial of service, memory corruption, or arbitrary code execution when processed by a vulnerable application.
RemediationAI
Immediately upgrade HTSlib to version 1.23.1, 1.22.2, or 1.21.1 or later depending on your currently deployed version line, as these releases contain the necessary fixes. Apply the patch commit 0ec436796eca7b4ce7fcc9b77270c102da29bb2e from the HTSlib repository (available at https://github.com/samtools/htslib/commit/0ec436796eca7b4ce7fcc9b77270c102da29bb2e). For applications embedding HTSlib, coordinate with upstream vendors for patched versions of dependent tools and re-link or recompile with the patched library. Until patching is possible, restrict file processing to files from trusted sources only and avoid processing CRAM files from untrusted repositories or external data sources. Implement strict file format validation at the application level and monitor for unexpected crashes or memory corruption issues in HTSlib-dependent services. There is no workaround available short of patching or avoiding CRAM format processing entirely.
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 widely-used C library for parsing bioinformatics file formats, particularly CRAM (Compressed Reference-aligned Alignments Map), which is a space-efficient format for storing DNA sequence alignment data. CRAM employs multiple encoding schemes including VARINT (variable-length integer) and CONST (constant value) encodings to compress alignment blocks. The vulnerability (CWE-121: Stack-based Buffer Overflow) stems from insufficient validation of the encoding context before writing decoded data, allowing writes that extend beyond allocated buffer sizes. The affected product is specifically identified via CPE cpe:2.3:a:samtools:htslib:*:*:*:*:*:*:*:* for all versions below the patched releases. The root cause involves the decoder not properly checking bounds or context constraints before committing decoded values to memory, a classic heap and stack buffer overflow scenario in C libraries.
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: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. For the VARINT and CONST encodings, incomplete validation of the context in which the encodings were used could result in up to eight bytes being written beyond the end of a heap allocation, or up to eight bytes being written to the location of a one byte variable on the stack, possibly causing the values to adjacent variables to change unexpectedly. 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 significant risk from CVE-2026-31968, a stack-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.
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-12942
NVD
CVE.org
EPSS
GitHub
VulDB
Exploit-DB