Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-31972

CVE-2026-31972: Samtools Use-After-Free Vulnerability

CVE-2026-31972 is a use-after-free vulnerability in Samtools mpileup command that may leak program state or cause crashes. This article covers the technical details, affected versions, security impact, and mitigation.

Published: March 20, 2026

CVE-2026-31972 Overview

CVE-2026-31972 is a Use After Free (UAF) vulnerability in SAMtools, a widely-used bioinformatics tool for reading, manipulating, and writing sequence alignment/map (SAM/BAM) format files. The vulnerability exists in the mpileup command, which outputs DNA sequences aligned against a known reference. Under certain conditions, reference data can be discarded prematurely, leading to an attempt to read from a pointer to freed memory.

Critical Impact

This vulnerability may allow information about program state to be leaked, potentially exposing sensitive genomic data or internal memory contents. It may also cause program crashes through invalid memory access, disrupting bioinformatics workflows.

Affected Products

  • SAMtools versions prior to 1.21.1
  • SAMtools versions prior to 1.22
  • All installations using the mpileup command with reference files

Discovery Timeline

  • 2026-03-18 - CVE-2026-31972 published to NVD
  • 2026-03-19 - Last updated in NVD database

Technical Details for CVE-2026-31972

Vulnerability Analysis

This Use After Free vulnerability occurs in the mpileup command's reference data management logic. The mpileup command processes DNA sequence alignments by outputting the reference position and all DNA bases aligned to that position. To optimize memory usage, the command discards reference data that is no longer needed after it has been printed.

The root cause lies in the buffer management structure within bam_plcmd.c. The original implementation used a two-element buffer (ref[2], ref_id[2], ref_len[2]) for storing reference data, which proved insufficient under certain processing conditions. This buffer undersize led to premature freeing of reference data that was still being accessed by other parts of the code.

Root Cause

The vulnerability stems from inadequate buffer sizing in the mplp_ref_t structure used to track reference data. The two-slot buffer design failed to account for edge cases where more reference tracking slots were needed, causing the system to overwrite or free data that was still in active use. This is a classic memory management issue where buffer capacity did not match operational requirements.

Attack Vector

The vulnerability is exploitable over the network by supplying specially crafted BAM/SAM files or reference data to a SAMtools instance running mpileup. An attacker could potentially:

  1. Craft malicious alignment files that trigger the premature data discard condition
  2. Cause information leakage by reading freed memory contents
  3. Trigger denial of service through program crashes

The patch addresses this by expanding the buffer from two to three elements:

c
 } mplp_conf_t;
 
 typedef struct {
-    char *ref[2];
-    int ref_id[2];
-    hts_pos_t ref_len[2];
+    char *ref[3];
+    int ref_id[3];
+    hts_pos_t ref_len[3];
 } mplp_ref_t;
 
-#define MPLP_REF_INIT {{NULL,NULL},{-1,-1},{0,0}}
+#define MPLP_REF_INIT {{NULL,NULL,NULL},{-1,-1,-1},{0,0,0}}
 
 typedef struct {
     samFile *fp;

Source: GitHub Commit 3036eb9af945fcef359427a2d359855553da4adf

Detection Methods for CVE-2026-31972

Indicators of Compromise

  • Unexpected crashes in SAMtools during mpileup operations
  • Abnormal memory access patterns in SAMtools processes
  • Unusual output corruption or garbled reference data in mpileup results
  • Process termination with segmentation fault signals during sequence alignment operations

Detection Strategies

  • Monitor SAMtools processes for segmentation faults or abnormal termination
  • Implement application logging to capture unexpected behavior during mpileup command execution
  • Deploy memory sanitizers (AddressSanitizer) in development/testing environments to detect use-after-free conditions
  • Review system logs for repeated SAMtools process crashes

Monitoring Recommendations

  • Configure process monitoring for SAMtools instances to alert on unexpected terminations
  • Implement file integrity monitoring on bioinformatics pipeline inputs
  • Monitor for unusual patterns of SAMtools restarts or error messages
  • Enable core dump analysis for crashed SAMtools processes to identify exploitation attempts

How to Mitigate CVE-2026-31972

Immediate Actions Required

  • Upgrade SAMtools to version 1.21.1 or 1.22 immediately
  • Audit systems for affected SAMtools versions using samtools --version
  • Restrict network access to systems running vulnerable SAMtools instances
  • Review and validate input sources for mpileup operations

Patch Information

The SAMtools development team has released fixed versions addressing this vulnerability. Users should update to SAMtools version 1.21.1 or 1.22 which contain the corrected buffer sizing in the mplp_ref_t structure. The fix is available in commit 3036eb9af945fcef359427a2d359855553da4adf. For detailed information, refer to the GitHub Security Advisory GHSA-72c8-4jf3-f27p.

Workarounds

  • There is no workaround for this issue - upgrading is required
  • As a temporary measure, restrict access to SAMtools instances from untrusted networks
  • Validate and sanitize all input files processed by mpileup
  • Consider running SAMtools in isolated containers with memory limits to contain potential crashes
bash
# Verify SAMtools version and upgrade if necessary
samtools --version

# On Debian/Ubuntu systems with bioconda
conda update -c bioconda samtools

# Building from source with the fix
git clone https://github.com/samtools/samtools.git
cd samtools
git checkout 1.22
make
make install

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeUse After Free

  • Vendor/TechSamtools

  • SeverityMEDIUM

  • CVSS Score6.9

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-416
  • Technical References
  • Openwall OSS Security Mailing List
  • Vendor Resources
  • GitHub Commit Changes

  • GitHub Security Advisory GHSA-72c8-4jf3-f27p
  • Related CVEs
  • CVE-2026-31973: Samtools CRAM File DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English