CVE-2026-31967: 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.4% chance of exploitation in 30 days – higher than 39% 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 and only effective mitigation is to upgrade htslib to a fixed version: 1.21.1, 1.22.2, 1.23.1, or later. Organizations should audit their bioinformatics toolchains and pipelines to identify usage of vulnerable htslib versions and plan immediate updates. Since no workaround exists, blocking or filtering untrusted CRAM files before processing can reduce risk temporarily. Implementing input validation or sandboxing the processing environment may limit impact from malformed files. Monitoring logs for crashes or unusual behavior in samtools or related tools can help detect exploitation attempts. Security teams should coordinate with bioinformatics teams to ensure timely patching and validate that all dependent tools are rebuilt against updated htslib versions. Additionally, organizations should review access controls around genomic data processing systems to limit exposure to untrusted inputs. Regularly updating threat intelligence feeds for any emerging exploits related to this CVE is recommended.
Description
HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data. In the `cram_decode_slice()` function called while reading CRAM records, the value of the mate reference id field was not validated. Later use of this value, for example when converting the data to SAM format, could result in the out of bounds array reads when looking up the corresponding reference name. If the array value obtained also happened to be a valid pointer, it would be interpreted as a string and an attempt would be made to write the data as part of the SAM record. This bug may allow information about program state to be leaked. It may also cause a program crash through an attempt to access invalid memory. Versions 1.23.1, 1.22.2 and 1.21.1 include fixes for this issue. There is no workaround for this issue.