Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessDeliver crafted .gzi index file
-
DeliveryVictim runs samtools/bcftools on file
-
ExploitTruncated count zeroes noffs buffer
-
ExecutionOOB heap write past malloc(0)
-
ImpactHeap corruption or process crash
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Numeric truncation prevention
|
| Exploitation Conditions | Exploitation requires a victim to locally load an attacker-controlled .gzi BGZF index file (via the bgzf_index_load_hfile code path) using an HTSlib-based tool such as samtools or bcftools, then perform a seek that invokes bgzf_useek(). The specific trigger is a .gzi index whose stored entry count is 0xFFFFFFFF (or any value that truncates in the 32-bit int noffs/moffs fields to zero), which collapses the allocation to malloc(0). Limiting factors: the vector is LOCAL (AV:L) - the attacker cannot reach this remotely - and requires passive user interaction (UI:P), i.e. the victim must choose to process the malicious index/data file; impact is confined to Low integrity and availability (heap corruption/crash) with no confidentiality impact and no confirmed code execution. Only deployments that read .gzi index files are affected. |
| Impact | This is a low-to-moderate real-world risk despite the alarming 'heap out-of-bounds write' phrasing. The CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:P) is explicitly LOCAL with passive user interaction and only Low vulnerable-system integrity and availability impact (VC:N/VI:L/VA:L), yielding a modest 4.8 base score - there is no confidentiality impact and no code-execution claim in the evidence, only heap corruption or crashes. The exploitation signals reinforce a non-urgent posture: EPSS is 0.12% (2nd percentile), the CVE is NOT on CISA KEV (no active exploitation), and the vuln.today Decision label is 'this_month' rather than act_now/emergency. A public PoC reference exists (the hackmd writeup by @haindpwn) and VulnCheck published an advisory, but the input does not confirm working exploit code; it is not verified as a weaponized exploit. The signals are consistent rather than conflicting: low EPSS, no KEV, low technical impact, and a local file-parsing vector all point to this being a 'patch in routine cycle' issue rather than a drop-everything emergency. The main caveat is that CWE-197 (numeric truncation) producing an OOB heap write past a malloc(0) buffer could in principle be escalated beyond a crash, but the evidence describes the outcome as heap corruption/crashes only. |
| Exploit ScenarioDerived | An attacker crafts a malicious .gzi BGZF index file whose entry count field is set to 0xFFFFFFFF; the 32-bit value truncates noffs to zero, so a malloc(0) buffer is allocated and subsequent index entries are written past it, with bgzf_useek() also performing an offs[-1] read. When a victim runs a tool such as samtools or bcftools that loads this crafted index alongside a data file, the heap is corrupted, typically crashing the process. A public PoC reference exists (hackmd writeup); it is not verified as working exploit code, and exploitation requires the victim to locally process attacker-supplied index/data files. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 28, 2026
Heap out-of-bounds write and read in HTSlib through 1.24 is triggered when a crafted .gzi BGZF index stores an entry count of 0xFFFFFFFF, which truncates the 32-bit noffs/moffs fields in bgzf_index_load_hfile() to zero and collapses the index allocation to malloc(0); subsequent writes past that buffer and an offs[-1] read in bgzf_useek() corrupt heap memory or crash HTSlib-based tools such as samtools and bcftools. The vector is local: the victim must load an attacker-supplied .gzi index file and then perform a seek, with assessed impact limited to Low integrity and Low availability - no confidentiality impact and no confirmed code execution. EPSS is 0.12% (2nd percentile), there is no CISA KEV listing, and a public technical write-up describing the truncation exists; it is not verified as working exploit code.
RemediationAI
Upstream fix available (PR/commit); released patched version not independently confirmed - the correction is carried in https://github.com/samtools/htslib/pull/2057 and commit 18dddf02bb2c0053b32acec427723555a24b2873, which the available sources do not map to a specific tagged HTSlib release, so consumers should update HTSlib (and rebuild samtools/bcftools against it) to a build containing that commit and confirm with the project at https://github.com/samtools/htslib before relying on any given version number. Until then, the practical control follows directly from the trigger: the corruption occurs at index-load time from attacker-controlled entry counts, so avoid opening .gzi index files received from untrusted or unverified sources and regenerate indexes locally from trusted BAM/VCF/BCF inputs with the corresponding samtools/bcftools index command, at the cost of recomputation time on large files. Because exploitation is local (AV:L) and requires the user to load the malicious index, restricting which files analysts process and running HTSlib tools under an unprivileged account limits the consequence of heap corruption to a crash of that process rather than a privileged one, though it does not prevent the out-of-bounds write itself.
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
BGZF (blocked GZIP) is the compressed container format underlying BAM, BCF and tabix-indexed genomics data, implemented in bgzf.c within HTSlib, the library shared by samtools, bcftools and many downstream bioinformatics tools. A .gzi file is a side index mapping uncompressed offsets to compressed block addresses, and bgzf_index_load_hfile() parses it by reading the stored entry count into a signed 32-bit int (noffs, moffs) before sizing the offset array. The defect is CWE-197 numeric truncation: a count of 0xFFFFFFFF does not fit the destination type, wraps to zero, and the resulting zero-sized allocation is then written past its end; the companion read path bgzf_useek() performs a binary search over the index and, with noffs-1 underflowing, reads offs[-1]. The supplied upstream fix (PR 2057) addresses the root cause class rather than the single value: it converts noffs/moffs and the loop indices to size_t, introduces a dedicated bgzf_index_grow() helper using hts_realloc_p() with proper allocation-failure propagation (replacing a kroundup32-based growth check), and rewrites the bgzf_useek() midpoint as ilo + (ihi - ilo) / 2 with a guarded ilo > 0 ? ilo-1 : 0 lower probe. Because the parsed count is attacker-controlled file content rather than a network-parsed length, exploitability depends entirely on a victim opening an untrusted index file.
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:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N
Local because the attacker supplies a file the victim must open (AV:L, UI:R); no auth needed (PR:N); no data disclosure (C:N) but heap corruption yields Low integrity and availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
HTSlib through 1.24 contains a heap out-of-bounds write and read vulnerability in bgzf_index_load_hfile() in bgzf.c that allows attackers to corrupt heap memory by supplying a crafted .gzi index entry count. A count of 0xFFFFFFFF truncates noffs to zero, causing writes past a malloc(0) buffer and an offs[-1] read in bgzf_useek(), resulting in heap corruption or crashes in tools like samtools and bcftools.
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.
An 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(
HTSlib contains a buffer overflow vulnerability in its CRAM format decoder affecting the VARINT and CONST encoding handl
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
HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1 contain a heap buffer overflow vulnerability in the GZI index loadin
HTSlib, a bioinformatics library for reading and writing sequence alignment formats, contains a null pointer dereference
EUVD-2026-110490
GHSA-r296-8jjg-794r
NVD
CVE.org
EPSS
Exploit-DB