CVE-2026-31964: samtools htslib · NULL Pointer Dereference
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 30 Oct 2026, 06:59 UTC
- EPSS
- 0.3% chance of exploitation in 30 days – higher than 26% 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:N/VI:L/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 only effective mitigation is to upgrade htslib to version 1.21.1, 1.22.2, 1.23.1, or later, where the NULL pointer dereference issue has been fixed. Organizations should audit their environments to identify all instances of samtools and htslib and verify the versions in use. Automated deployment tools can facilitate rapid patching across research clusters and production systems. Since no workaround exists, blocking or filtering CRAM files from untrusted sources may reduce exposure but is not a substitute for patching. Implementing input validation and sandboxing bioinformatics processing pipelines can limit the impact of crashes. Monitoring for abnormal application crashes or denial-of-service symptoms during CRAM file processing can help detect exploitation attempts. Finally, maintaining an inventory of bioinformatics tools and dependencies and integrating vulnerability management into research IT operations will improve resilience against similar issues.
Description
HTSlib is a library for reading and writing bioinformatics file formats. CRAM is a compressed format which stores DNA sequence alignment data using a variety of encodings and compression methods. While most alignment records store DNA sequence and quality values, the format also allows them to omit this data in certain cases to save space. Due to some quirks of the CRAM format, it is necessary to handle these records carefully as they will actually store data that needs to be consumed and then discarded. Unfortunately the `CONST`, `XPACK` and `XRLE` encodings did not properly implement the interface needed to do this. Trying to decode records with omitted sequence or quality data using these encodings would result in an attempt to write to a NULL pointer. Exploiting this bug causes a NULL pointer dereference. Typically this will cause the program to crash. Versions 1.23.1, 1.22.2 and 1.21.1 include fixes for this issue. There is no workaround for this issue.