CVE-2026-31972: 
NixOS vulnerability analysis and mitigation

Overview

CVE-2026-31972 is a use-after-free vulnerability in the mpileup command of SAMtools, a widely used bioinformatics toolkit for reading, manipulating, and writing genomic file formats. Under certain conditions, reference sequence data is discarded (freed) prematurely during pileup output processing, leading to a subsequent read from a freed memory pointer. All SAMtools versions up to and including 1.21 are affected; the issue is fixed in versions 1.21.1 and 1.22. It was publicly disclosed on March 18, 2026, by the SAMtools team via GitHub Security Advisories and the oss-security mailing list. The CVSS v4.0 base score is 6.9 (Medium), while an NVD CVSS v3.1 score of 9.8 (Critical) has also been assigned (GitHub Advisory, Red Hat Bugzilla, oss-security).

Technical details

The root cause is a use-after-free (CWE-416) combined with an expired pointer dereference (CWE-825) in the mplp_get_ref() function within bam_plcmd.c. The mpileup command cached only two in-flight reference sequences, but the pileup logic actually requires up to three simultaneously — the current reference, the previous reference (needed when the -a flag is used to output all positions), and potentially the next reference used by bam_mplp64_auto. When a third reference was needed, the oldest cached reference was freed too early; if that freed reference was subsequently accessed, the program read from an invalid (freed) memory location. The fix, committed as 3036eb9, expands the reference cache from 2 to 3 slots with improved cache management logic (GitHub Advisory, GitHub Commit).

Impact

Successful exploitation can result in two primary consequences: leakage of internal program state (memory contents) that could expose sensitive bioinformatics data, and a program crash due to invalid memory access, causing denial of service. In bioinformatics pipeline contexts, leaked memory may contain genomic sequence data or file path information processed by the tool. The CVSS v4.0 scoring reflects low confidentiality and low availability impact on the vulnerable system, with no integrity impact (GitHub Advisory, Red Hat Bugzilla).

Exploitability

No public proof-of-concept exploit code or evidence of in-the-wild exploitation has been reported as of the time of disclosure (GitHub Advisory). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.013% (0.000130), indicating a very low probability of exploitation in the near term. The bug is triggered under specific conditions involving multiple reference sequences and use of the -a flag, which may limit opportunistic exploitation (oss-security).

Mitigation and workarounds

The only remediation is to upgrade SAMtools to version 1.21.1 or 1.22, both of which contain the fix. The SAMtools team has explicitly stated there is no workaround for this issue. Organizations running SAMtools in automated bioinformatics pipelines or as a network-accessible service should prioritize patching, particularly if the mpileup command is used with multiple reference sequences or the -a flag (GitHub Advisory, oss-security).

Community reactions

The vulnerability was disclosed directly by the SAMtools development team (Wellcome Sanger Institute) via the oss-security mailing list and GitHub Security Advisories on March 18, 2026. Red Hat tracked the issue via Bugzilla (Bug 2448857) and classified it as medium severity. Coverage appeared on vulnerability aggregation platforms including VulDB, cvefeed.io, and Tenable (Nessus plugin 303033), as well as the German pro-linux.de security news site (oss-security, Red Hat Bugzilla).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

samtools

Affected

sid

samtools

Affected

trixie

samtools

Affected

Ubuntu

Unknown

bionic (esm-apps)

samtools

Unknown

devel

samtools

Unknown

focal (esm-apps)

samtools

Unknown

jammy

samtools

Unknown

jammy (esm-apps)

samtools

Unknown

noble

samtools

Unknown

noble (esm-apps)

samtools

Unknown

resolute

samtools

Unknown

Source: This report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-112940HIGH7.1
  • Python logoPython
  • py3-filelock
NoYesOct 20, 2026
CVE-2026-112937MEDIUM6.1
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112936MEDIUM6.1
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112939MEDIUM4.7
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112941LOW3.3
  • Python logoPython
  • filelock
NoYesOct 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management