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.
Severity (CVSS)
| Base score | 4.8 |
|---|---|
| Severity | Medium |
| Version | CVSS 4.0 |
| 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 |
| Provided by | CNA |
Weaknesses
- CWE-197 — Numeric Truncation Error
Affected products
| Vendor | Product | Versions |
|---|---|---|
| samtools | htslib | 0 to <=1.24 [affected] |
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)
Assess this vulnerability
Compare your deployed product and version with the source record. Review vendor references for fixes and workarounds. A CVSS score describes technical severity; it does not establish that your systems are affected or that exploitation has occurred.
Browse all CVE security advisories · Symaro cybersecurity services
Generated from the official CVE List on 27 Oct 2026 07:01 UTC.