# CVE-2026-31972: samtools mpileup has use-after-free leading to an invalid read

- Severity: Medium 6.9 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.76%, higher than 52% of CVEs (2026-11-29)
- Published: 2026-03-18T20:32:29.862Z
- Modified: 2026-06-17T10:34:52.140Z
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

SAMtools is a program for reading, manipulating and writing bioinformatics file formats. The `mpileup` command outputs DNA sequences that have been aligned against a known reference. On each output line it writes the reference position, optionally the reference DNA base at that position (obtained from a separate file) and all of the DNA bases that aligned to that position. As the output is ordered by position, reference data that is no longer needed is discarded once it has been printed out. Under certain conditions the data could be discarded too early, leading to an attempt to read from a pointer to freed memory. 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. This bug is fixed in versions 1.21.1 and 1.22. There is no workaround for this issue.

(As written by CVE List.)

## Affected

- samtools samtools: < 1.21.1; before 1.21.1

## Every score

- GitHub_M: CVSS:4.0 6.9 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/samtools/samtools/security/advisories/GHSA-72c8-4jf3-f27p> (vendor-advisory)
- <https://github.com/samtools/samtools/commit/3036eb9af945fcef359427a2d359855553da4adf> (patch)
- <http://www.openwall.com/lists/oss-security/2026/03/18/11> (mailing-list, third-party-advisory)

## Sources

- CVE List: [CVE-2026-31972](https://www.cve.org/CVERecord?id=CVE-2026-31972), CVE Terms of Use, modified 2026-03-19
- NVD: [CVE-2026-31972](https://nvd.nist.gov/vuln/detail/CVE-2026-31972), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-31972 · Whole record: https://cve.day/CVE-2026-31972.json · Rebuilt by cve.day 2026-11-25T22:59:16.137Z
