# CVE-2026-116742: HTSlib through 1.24 Heap Out-of-Bounds Write via Truncated .gzi Index Count

- Severity: Medium 4.8 (CVSS:4.0, scored by VulnCheck) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.16%, higher than 5% of CVEs (2026-12-01)
- Published: 2026-10-26T21:52:41.511Z
- Modified: 2026-10-27T16:04:22.707Z
- Weaknesses: CWE-197
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: VulnCheck

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

(As written by CVE List.)

## Affected

- samtools htslib: up to 1.24

## Every score

- VulnCheck: CVSS:4.0 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`
- VulnCheck: CVSS:3.1 4.4 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L`

## References

- <https://github.com/samtools/htslib/pull/2057> (issue-tracking, patch)
- <https://github.com/samtools/htslib/commit/18dddf02bb2c0053b32acec427723555a24b2873> (patch)
- <https://github.com/samtools/htslib> (product)
- <https://github.com/samtools/htslib/blob/1.24/bgzf.c#L2504> (technical-description)
- <https://hackmd.io/@haindpwn/htslib-bgzf-gzi-int-truncation-oob> (third-party-advisory)
- <https://github.com/samtools/htslib/issues/2113> (issue-tracking)
- <https://www.vulncheck.com/advisories/htslib-through-1.24-heap-out-of-bounds-write-via-truncated-gzi-index-count> (third-party-advisory)

## Sources

- CVE List: [CVE-2026-116742](https://www.cve.org/CVERecord?id=CVE-2026-116742), CVE Terms of Use, modified 2026-10-27
- NVD: [CVE-2026-116742](https://nvd.nist.gov/vuln/detail/CVE-2026-116742), Public domain, modified 2026-10-27

---

Page: https://cve.day/CVE-2026-116742 · Whole record: https://cve.day/CVE-2026-116742.json · Rebuilt by cve.day 2026-11-25T22:59:47.303Z
