CVE-2026-31965: samtools htslib · Out-of-bounds Read
Affects samtools htslibSource CVE Database V5
Not known to be exploited · CVSS 6.9 Medium : upgrade to 1.22.2 or 1.21.1 when convenient.
Data as of 29 Oct 2026, 19:04 UTC
- EPSS
- 0.3% chance of exploitation in 30 days – higher than 32% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 1.22.2, 1.21.1
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 18 Mar 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.
What to do
Upgrade htslib to 1.22.2 or 1.21.1; samtools/htslib to 1.21.1.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| samtoolshtslib | Affected
| Fixed in
|
GitHubsamtools/htslibpkg:github/samtools/htslibOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
The primary mitigation is to upgrade htslib to a fixed version: 1.21.1, 1.22.2, or 1.23.1 or later. Organizations should audit their environments to identify all instances of samtools and htslib and verify the versions in use. For environments where immediate upgrade is not feasible, implement strict input validation and filtering to block untrusted or malformed CRAM files before processing. Employ runtime protections such as memory safety tools (e.g., AddressSanitizer) during development and testing to detect similar issues early. Monitor logs and application behavior for crashes or anomalies that may indicate exploitation attempts. Additionally, restrict access to systems processing genomic data to trusted users and networks to reduce exposure. Maintain up-to-date backups and incident response plans to quickly recover from potential denial of service caused by exploitation.
Description
CVE-2026-31965 is a medium severity out-of-bounds read vulnerability in the htslib library used by samtools for processing bioinformatics file formats, specifically CRAM files. The flaw occurs in the cram_decode_slice() function where reference ID validation happens too late, allowing two out-of-bounds reads before error detection. This can lead to leaking of two values to the caller or cause program crashes due to invalid memory access. Exploitation does not require authentication or user interaction and can be triggered remotely by processing crafted CRAM files. Fixed versions 1.21.1, 1.22.2, and 1.23.