Skip to main content

Samtools CVE-2026-31972

| EUVDEUVD-2026-12956 MEDIUM
Use After Free (CWE-416)
2026-03-18 GitHub_M
Medium
Disputed · 6.9 NVD
View

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Impact

While a CVSS score was not assigned, the underlying severity is moderate to high based on the available signals. The vulnerability is classified as a use-after-free with memory corruption implications, which typically carries exploitability risk. The CWE-416 classification confirms a memory safety defect that can be triggered remotely if the mpileup command processes untrusted or maliciously crafted alignment data. Attack vector is likely network or local file-based depending on deployment context. The absence of CVSS and EPSS metrics prevents quantitative comparison, but the availability of a vendor patch (versions 1.21.1 and 1.22) and public advisory indicate this was treated seriously by maintainers. The primary real-world risk depends on exposure: bioinformatics pipelines processing untrusted sequencing data face higher risk than those processing validated internal datasets. Information disclosure is the lower-impact outcome; denial of service through crash is more probable and operationally significant.

Exploit ScenarioDerived

An attacker or malicious actor provides a crafted BAM/SAM alignment file with specific positional characteristics that trigger premature deallocation of reference sequence buffers. When a user or automated bioinformatics pipeline processes this file through the mpileup command, the use-after-free condition is triggered, either leaking sensitive memory contents (such as uninitialized buffer data or adjacent heap structures) or causing a denial-of-service crash. The attack requires ability to supply input data to SAMtools, which is feasible in collaborative research environments or public data repository scenarios where alignment files are shared among researchers.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 18, 2026

SAMtools mpileup command contains a use-after-free vulnerability in reference data management that can leak sensitive program state information or trigger application crashes when processing aligned DNA sequences. The vulnerability affects versions prior to 1.2 and requires no authentication or user interaction to exploit, though a patch is not yet available. An attacker could leverage this to obtain information disclosure or cause denial of service against systems processing bioinformatics data with vulnerable SAMtools versions.

Earlier versions of this analysis (1)
v1 Mar 18, 2026 - 21:00 CVSS 6.9

A use-after-free vulnerability exists in SAMtools' mpileup command where reference DNA sequence data is prematurely freed from memory, allowing subsequent operations to read from invalid pointers. This affects SAMtools versions prior to 1.21.1 and 1.22, and can result in information disclosure leaking program state or denial of service through memory access violations. No active exploitation in the wild has been confirmed, but the vulnerability is readily exploitable given the straightforward triggering conditions described in the advisory.

RemediationAI

Upgrade SAMtools to version 1.21.1 or 1.22 (or later) immediately, as these are the confirmed patched versions addressing this use-after-free condition. The fix is available in the upstream repository at commit 3036eb9af945fcef359427a2d359855553da4adf. No workaround is available for this vulnerability according to the official advisory, so patching is mandatory. For organizations unable to update immediately, restrict mpileup command execution to trusted, validated sequencing data sources and implement process isolation or containerization to limit the blast radius of potential crashes.

Affected VersionsENISA

samtools < 1.21.1

Affected Packages

euvd samtools fix: 1.21.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

SAMtools is a bioinformatics utility suite used for processing DNA sequence alignment files (BAM/SAM formats). The mpileup command specifically reads aligned sequences and outputs them alongside reference sequence data obtained from a separate reference file. The vulnerability is rooted in CWE-416 (use-after-free), a memory safety defect where the reference data buffer is deallocated prematurely based on position ordering assumptions. When certain input conditions occur, the code attempts to access reference positions that have already been freed, causing the program to dereference invalid memory pointers. The affected product is identified by CPE cpe:2.3:a:samtools:samtools:*:*:*:*:*:*:*:*, indicating all versions below the patched releases are in scope.

Know when Samtools gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Sources disagree (Medium–Critical)
GitHub Advisory PRIMARY 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
SUSE 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Apr 16, 2026 - 05:29 EUVD
1.21.1
CVE Published
Mar 18, 2026 - 20:32 nvd
MEDIUM 6.9

DescriptionGitHub Advisory

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.

Executive ViewAI

Why It Matters

Organizations using SAMtools should be aware of notable risk from CVE-2026-31972, a use-after-free vulnerability rated CVSS 6.9. Exploitation could compromise the security of affected deployments. Organizations should apply vendor updates when available and monitor for exploitation.

Business Impact: Moderate
Compensating Controls

Apply vendor patch. If patching is delayed: enable ASLR/DEP, apply network segmentation.

Threat Intelligence Overview

EPSS Score
0.0%
Top 98% exploitable
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Related Vulnerabilities in SAMtools Multiple Memory Safety Issues

View all 2
CVE-2022-21126 HIGH POC
7.8 Nov 29

The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insec

CVE-2026-31963 HIGH
8.8 Mar 18

HTSlib contains a heap buffer overflow vulnerability in its CRAM decoder caused by an out-by-one error when validating f

CVE-2026-31962 HIGH
8.8 Mar 18

HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1 contain a heap buffer overflow vulnerability in the cram_decode_seq(

CVE-2026-31968 HIGH
8.8 Mar 18

HTSlib contains a buffer overflow vulnerability in its CRAM format decoder affecting the VARINT and CONST encoding handl

CVE-2026-62258 HIGH
8.8 Nov 19

Stack-based buffer overflow in HTSlib's CRAM decoder affects all releases before 1.21.2, 1.22.3, 1.23.2, and 1.24: a cra

CVE-2026-62257 HIGH
8.8 Nov 19

Heap out-of-bounds read and write in HTSlib's experimental CRAM v4 XPACK and XRLE decoders allows a remote, unauthentica

CVE-2026-63390 HIGH
8.8 Nov 19

Heap buffer overflow in HTSlib's BCF reader allows an attacker-crafted BCF file to corrupt heap memory when opened by an

CVE-2026-31971 HIGH
7.1 Mar 18

HTSlib, a widely-used bioinformatics library for reading and writing sequence alignment formats, contains a critical buf

CVE-2026-31969 HIGH
7.1 Mar 18

HTSlib versions prior to 1.21.1, 1.22.2, and 1.23.1 contain an out-by-one error in the CRAM decoder's `cram_byte_array_s

CVE-2026-31970 HIGH
7.1 Mar 18

HTSlib versions prior to 1.23.1, 1.22.2, and 1.21.1 contain a heap buffer overflow vulnerability in the GZI index loadin

CVE-2026-62256 HIGH
7.1 Nov 19

A heap-based buffer overflow in HTSlib's fai_retrieve allows a crafted FASTA .fai index to write one byte past the end o

CVE-2026-62255 HIGH
7.1 Nov 19

Heap-based memory corruption in HTSlib's CRAM index loader (cram_index_load) lets a malformed .crai index drive out-of-b

Vendor StatusVendor

SUSE

Severity: Critical

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy