Skip to main content

HTSlib CVE-2026-116742

| EUVDEUVD-2026-110490 MEDIUM
Numeric Truncation Error (CWE-197)
2026-10-26 VulnCheck GHSA-r296-8jjg-794r
4.8
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Deliver crafted .gzi index file
  2. Delivery
    Victim runs samtools/bcftools on file
  3. Exploit
    Truncated count zeroes noffs buffer
  4. Execution
    OOB heap write past malloc(0)
  5. Impact
    Heap 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

htslib 0 ≤1.24

Affected Packages

euvd htslib no fix

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

Vendor (VulnCheck) PRIMARY 4.8 MEDIUM
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
vuln.today AI 4.4 MEDIUM

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.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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

EPSS Score
0.1%
Top 98% exploitable
Prevalence
Low
bioinformatics library for genomics; industry-specific, not general enterprise
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

24
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +24
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

More in Htslib

View all
CVE-2018-13843 HIGH POC
7.5 Jul 10

An issue has been found in HTSlib 1.8. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no au

CVE-2017-1000206 CRITICAL
9.8 Nov 17

samtools htslib library version 1.4.0 and earlier is vulnerable to buffer overflow in the CRAM rANS codec resulting in p

CVE-2018-13845 CRITICAL
9.8 Jul 10

An issue has been found in HTSlib 1.8. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitable, n

CVE-2026-31963 HIGH
8.8 Mar 18

HTSlib contains a heap buffer overflow vulnerability in its CRAM decoder caused by an out-by-one error when validating f

CVE-2026-31962 HIGH
8.8 Mar 18

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(

CVE-2026-31968 HIGH
8.8 Mar 18

HTSlib contains a buffer overflow vulnerability in its CRAM format decoder affecting the VARINT and CONST encoding handl

CVE-2018-14329 MEDIUM POC
4.7 Jul 17

In HTSlib 1.8, a race condition in cram/cram_io.c might allow local users to overwrite arbitrary files via a symlink att

CVE-2018-13844 HIGH
7.5 Jul 10

An issue has been found in HTSlib 1.8. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no au

CVE-2026-31971 HIGH
7.1 Mar 18

HTSlib, a widely-used bioinformatics library for reading and writing sequence alignment formats, contains a critical buf

CVE-2026-31969 HIGH
7.1 Mar 18

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

CVE-2026-31970 HIGH
7.1 Mar 18

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

CVE-2026-31964 MEDIUM
6.9 Mar 18

HTSlib, a bioinformatics library for reading and writing sequence alignment formats, contains a null pointer dereference

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy