The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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
    • 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-2025-8194

CVE-2025-8194: CPython tarfile Module DoS Vulnerability

CVE-2025-8194 is a denial of service flaw in CPython's tarfile module that causes infinite loops when processing malicious tar archives with negative offsets. This article covers the technical details, impact, and mitigation.

Updated: January 22, 2026

CVE-2025-8194 Overview

A defect has been discovered in the CPython tarfile module affecting the TarFile extraction and entry enumeration APIs. The vulnerability allows attackers to cause an infinite loop and deadlock by crafting malicious tar archives containing negative offsets. When Python applications process these specially crafted archives, the tar implementation fails to properly validate offset values, resulting in a denial of service condition.

Critical Impact

Processing maliciously crafted tar archives can cause Python applications to enter an infinite loop, leading to service deadlock and denial of service. Any application using the tarfile module to process untrusted tar archives is potentially vulnerable.

Affected Products

  • CPython (all versions prior to the security patches)
  • Applications using the Python tarfile module for archive extraction
  • Services processing untrusted tar archives via Python

Discovery Timeline

  • 2025-07-28 - CVE-2025-8194 published to NVD
  • 2025-11-04 - Last updated in NVD database

Technical Details for CVE-2025-8194

Vulnerability Analysis

This vulnerability (CWE-835: Loop with Unreachable Exit Condition) resides in the CPython tarfile module's internal block calculation function _block(). The function is responsible for rounding up byte counts to the tar block size (typically 512 bytes) during archive parsing and member extraction operations.

The core issue is that the _block() function did not validate whether the input count value was non-negative before performing the block calculation. When processing a maliciously crafted tar archive containing members with negative offset values, the divmod() operation would produce unexpected results, causing the archive parsing logic to enter an infinite loop. This condition persists indefinitely, causing the Python process to deadlock and become unresponsive.

The vulnerability is network-exploitable because tar archives are commonly transmitted over networks and processed by web applications, data processing pipelines, and file upload handlers. An attacker only needs to convince or trick an application into processing their malicious archive to trigger the denial of service condition.

Root Cause

The root cause lies in missing input validation within the _block() internal function of the tarfile module. The function calculates block-aligned byte counts using divmod(count, BLOCKSIZE) but did not verify that the count parameter was a valid non-negative integer before processing. This allowed negative offset values embedded in malicious tar headers to propagate through the parsing logic, ultimately causing infinite iteration during archive enumeration or extraction.

Attack Vector

An attacker can exploit this vulnerability by:

  1. Crafting a malicious tar archive with specially constructed headers containing negative offset values
  2. Delivering the archive to a target system through file uploads, email attachments, API endpoints, or any mechanism that triggers tar processing
  3. When the victim application opens or iterates through the archive using TarFile extraction or enumeration methods, the infinite loop is triggered
  4. The affected Python process becomes unresponsive, consuming CPU resources indefinitely until manually terminated

The attack requires no authentication and can be performed remotely against any service that processes tar archives from untrusted sources.

python
# Security patch from CPython - Lib/tarfile.py
# Source: https://github.com/python/cpython/commit/57f5981d6260ed21266e0c26951b8564cc252bc2

         """Round up a byte count by BLOCKSIZE and return it,
            e.g. _block(834) => 1024.
         """
+        # Only non-negative offsets are allowed
+        if count < 0:
+            raise InvalidHeaderError("invalid offset")
         blocks, remainder = divmod(count, BLOCKSIZE)
         if remainder:
             blocks += 1

The patch adds explicit validation to reject negative offset values by raising an InvalidHeaderError exception before the problematic calculation can occur.

Detection Methods for CVE-2025-8194

Indicators of Compromise

  • Python processes showing sustained 100% CPU utilization when processing tar files
  • Application threads or workers becoming unresponsive during archive operations
  • Service timeouts occurring specifically during tar file extraction workflows
  • Unusual tar archives in upload directories or processing queues with malformed headers

Detection Strategies

  • Monitor Python application processes for unexpectedly long-running tarfile operations
  • Implement watchdog timers around tar extraction operations to detect infinite loop conditions
  • Deploy application performance monitoring (APM) to identify CPU spikes during file processing
  • Review incoming tar archives for structural anomalies before processing in production systems

Monitoring Recommendations

  • Enable process monitoring to alert on Python processes exceeding normal CPU or execution time thresholds
  • Implement request timeout policies for endpoints that accept and process tar archives
  • Log all tar file processing operations with timing metrics to identify anomalous behavior patterns
  • Monitor system resource utilization for sudden spikes correlated with archive processing activities

How to Mitigate CVE-2025-8194

Immediate Actions Required

  • Update CPython installations to versions containing the security patches
  • Apply the official workaround patch for environments where immediate Python upgrades are not feasible
  • Review all application code that processes tar archives from untrusted sources
  • Implement timeout mechanisms around tar extraction operations as a defense-in-depth measure

Patch Information

The Python Security Response Team has released patches across multiple CPython branches. Organizations should update to patched versions as soon as possible. Detailed patch information is available in the CPython Pull Request and the Python Security Announcement. Multiple commits have been applied to various Python branches including 3.9, 3.10, and main.

Workarounds

  • Apply the official mitigation patch available at the GitHub Gist provided by Seth Larson after importing the tarfile module
  • Implement application-level timeout wrappers around all tar processing code
  • Validate tar archives using external tools before processing with Python applications
  • Consider sandboxing tar extraction operations in isolated processes with resource limits
python
# Apply the official workaround after importing tarfile
# Source: https://gist.github.com/sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1

import tarfile

# Import and apply the mitigation patch
# See the GitHub Gist for the complete workaround implementation
# This patches the tarfile module to validate offsets before processing

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechPython

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.10%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-835
  • Technical References
  • GitHub Gist Code Snippet

  • GitHub CPython Commit Update

  • GitHub CPython Commit Change

  • GitHub CPython Commit Fix

  • GitHub CPython Commit Improvement

  • GitHub CPython Commit Patch

  • GitHub CPython Commit Refactor

  • GitHub CPython Commit Update

  • GitHub CPython Issue Discussion

  • GitHub CPython Pull Request

  • Python Security Announce Thread

  • Openwall OSS-Security Mailing List Post

  • Openwall OSS-Security Mailing List Post
  • Related CVEs
  • CVE-2025-13836: Python Python DOS Vulnerability

  • CVE-2026-0994: Google Protobuf Python DoS Vulnerability

  • CVE-2024-8088: CPython zipfile.Path DOS Vulnerability

  • CVE-2024-7592: Python CPython DOS Vulnerability
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