{"id":"CVE-2026-116742","kind":"vulnerability","aliases":["CVE-2026-116742"],"related":[],"title":"HTSlib: crafted .gzi index causes heap out-of-bounds write and read","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.","summary":"HTSlib through 1.24 mishandles a .gzi index entry count of 0xFFFFFFFF in bgzf_index_load_hfile(), so noffs truncates to zero and writes go past a malloc(0) buffer. An attacker who supplies a crafted index file can corrupt heap memory, causing crashes or possibly further memory corruption in tools such as samtools and bcftools.","severity":"medium","cvss":4.8,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["bcftools","bioinformatics","c","htslib","package","samtools"],"not_affected_if":["no-gzi-indexes","trusted-input-only"],"how_to_check":"- Check the installed HTSlib or samtools version with `samtools --version` and compare it with the fixed release in the sources (unknown from the sources).\n- Find whether tools process untrusted BGZF files with `.gzi` indexes, for example in pipelines that accept user-uploaded BAM, VCF or BGZF inputs.","fix":"- Upgrade HTSlib, and the samtools and bcftools builds that link it, to a release later than 1.24 (the fixed version is unknown from the sources).\n- Until patched, do not index or seek into `.gzi` files from untrusted sources.","status":"open","published_at":"2026-10-26T22:16:58+00:00","first_seen_at":"2026-10-26T22:25:34+00:00","triaged_at":"2026-10-26T22:28:12+00:00","updated_at":"2026-10-26T22:28:12+00:00","category":"package","confidence":0.6,"triage":{"at":"2026-10-26T22:28:12Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade HTSlib, and the samtools and bcftools builds that link it, to a release later than 1.24 (the fixed version is unknown from the sources).\n- Until patched, do not index or seek into `.gzi` files from untrusted sources.","reach":"unknown","title":"HTSlib: crafted .gzi index causes heap out-of-bounds write and read","impact":"medium","summary":"HTSlib through 1.24 mishandles a .gzi index entry count of 0xFFFFFFFF in bgzf_index_load_hfile(), so noffs truncates to zero and writes go past a malloc(0) buffer. An attacker who supplies a crafted index file can corrupt heap memory, causing crashes or possibly further memory corruption in tools such as samtools and bcftools.","category":"package","nicknames":[],"who_cares":["htslib","samtools","bcftools","bioinformatics","c"],"confidence":0.6,"needs_auth":"no","worst_case":"heap memory corrupted, causing crashes or possible code execution","analyst_note":"Confirm the fixed HTSlib version and whether the NVD entry or upstream commit shows exploitability beyond crashes.","how_to_check":"- Check the installed HTSlib or samtools version with `samtools --version` and compare it with the fixed release in the sources (unknown from the sources).\n- Find whether tools process untrusted BGZF files with `.gzi` indexes, for example in pipelines that accept user-uploaded BAM, VCF or BGZF inputs.","needs_analyst":true,"not_affected_if":["trusted-input-only","no-gzi-indexes"],"who_is_affected":"Teams that run HTSlib-based tools such as samtools or bcftools on untrusted or externally supplied BGZF and index files, for example in genomics pipelines or file-processing services. Systems that only process files they generated themselves are much less exposed. The sources do not say whether the flaw reaches code execution in practice.","user_interaction":"unknown","needs_special_setup":"unknown","severity_if_unknown":"unknown"},"cost_usd":0.000698,"input_tokens":3401,"output_tokens":716,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-1':135C '-116742':16A,19A '-2026':15A,18A '0':53B,130C '0xffffffff':36B,120C '1.24':28B,83C 'allow':103C 'attack':56B,104C 'bcftool':20B,80B,151C 'bgzf':38B,96C,138C 'bgzf.c':101C 'bioinformat':21B 'bound':10A,90C 'buffer':54B,131C 'c':22B 'caus':5A,67B,125C 'contain':84C 'corrupt':64B,73B,106C,143C 'count':34B,116C,118C 'craft':2A,60B,112C 'crash':68B,145C 'cve':14A,17A 'entri':33B,115C 'file':62B 'go':49B 'gzi':3A,31B,113C 'heap':6A,65B,86C,107C,142C 'hfile':41B,99C 'htslib':1A,23B,26B,81C 'index':4A,32B,39B,61B,97C,114C 'like':148C 'load':40B,98C 'malloc':52B,129C 'memori':66B,72B,108C 'mishandl':29B 'noff':43B,122C 'off':134C 'out-of-bound':7A,87C 'packag':24B 'past':50B,127C 'possibl':70B 'read':13A,93C,136C 'result':140C 'samtool':25B,78B,149C 'suppli':58B,110C 'tool':75B,147C 'truncat':44B,121C 'useek':139C 'vulner':94C 'write':11A,48B,91C,126C 'zero':46B,124C","nicknames":[],"mitigations":[],"who_affected":"Teams that run HTSlib-based tools such as samtools or bcftools on untrusted or externally supplied BGZF and index files, for example in genomics pipelines or file-processing services. Systems that only process files they generated themselves are much less exposed. The sources do not say whether the flaw reaches code execution in practice.","tier":"C","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-26T22:16:58+00:00","kev":null,"cvss_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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"disclosure@vulncheck.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-116742","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-116742","severity":null,"published_at":"2026-10-26T22:16:58+00:00","modified_at":"2026-10-26T22:16:58+00:00","first_seen_at":"2026-10-26T22:25:34+00:00","fetched_at":"2026-10-26T22:25:34+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}