CVE-2026-116742

HTSlib through 1.24 Heap Out-of-Bounds Write via Truncated .gzi Index Count

Published Oct 26, 2026 CVSS 4.0 · 4.8 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

HTSlib through version 1.24 contains a heap out-of-bounds write and read in the bgzf_index_load_hfile() function. A maliciously crafted .gzi index entry count of 0xFFFFFFFF truncates the noffs value to zero, causing writes beyond a malloc(0) buffer and a subsequent unsafely indexed read. This corrupts heap memory or causes application termination in utilities such as samtools and bcftools.

Affected Systems

The vulnerable code is part of the htslib library shipped with Samtools. All releases up to and including version 1.24 are affected; newer releases past 1.24 are not known to contain the flaw.

Risk and Exploitability

The CVSS score of 4.8 indicates moderate impact. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog. The attack requires an attacker to supply a malformed .gzi index file, which can be delivered locally or over a network if tools accept untrusted input. The likely attack vector is a local or network‑based file injection scenario, inferred from the nature of the flaw and the need for a crafted index entry count.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade htslib to a version newer than 1.24, preferably the latest stable release.
  • Verify that all .gzi index files used by samtools and bcftools originate from trusted sources and check the entry count for plausibility before use.
  • Consider running tools with sandboxing or address‑sanitization defenses to detect and contain potential heap corruption during development or testing.

Generated by OpenCVE AI on October 27, 2026 at 08:08 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Samtools
Samtools htslib
Vendors & Products Samtools
Samtools htslib
Type Values Removed Values Added
Description 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.
Title HTSlib through 1.24 Heap Out-of-Bounds Write via Truncated .gzi Index Count
First Time appeared Htslib
Htslib htslib
Weaknesses CWE-197
CPEs cpe:2.3:a:htslib:htslib:*:*:*:*:*:*:*:*
Vendors & Products Htslib
Htslib htslib
References
Metrics cvssV3_1

{'score': 4.4, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L'}

cvssV4_0

{'score': 4.8, 'vector': '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'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Oct 27, 2026, 2:16 PM
Reserved
Oct 26, 2026, 8:23 PM
Status
Deferred
Published
Oct 26, 2026, 10:16 PM
Modified
Oct 27, 2026, 4:04 PM