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.
Published: 2026-10-26
Score: 4.8 Medium
EPSS: n/a
KEV: No
Impact: Heap Out‑of‑Bounds Write and Read leading to heap corruption or crashes.
Action: Patch Upgrade
AI Analysis

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.

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

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 yet.

History

Tue, 27 Oct 2026 10:30:00 +0000

Type Values Removed Values Added
First Time appeared Samtools
Samtools htslib
Vendors & Products Samtools
Samtools htslib

Tue, 27 Oct 2026 04:30:00 +0000

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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-10-26T21:52:41.511Z

Reserved: 2026-10-26T20:23:36.636Z

Link: CVE-2026-116742

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-26T22:16:58.680

Modified: 2026-10-26T22:16:58.680

Link: CVE-2026-116742

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-27T10:15:17Z

Weaknesses