Critical Vulnerability in Python Packages: CVE-2025-8194 - Infinite Loop in Tarfile Module

python2.7 Updated 03 Oct 2025

Summary

28/07/2025
N/A
Yes i
High
7.5

UBUNTU-CVE-2025-8194: There is a defect in the CPython “tarfile” module affecting the “TarFile” extraction and entry enumeration APIs. Affects python2.7 versions < 2.7.6-8ubuntu0.6+esm26. Fixed in 2.7.6-8ubuntu0.6+esm26. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Python is a widely-used high-level programming language known for its readability and versatility. It is utilized in various applications, from web development to data analysis. The affected packages, including python2.7, python3.4, python3.5, python3.6, python3.7, python3.8, python3.9, python3.10, python3.11, and python3.13, are essential components of the Python ecosystem, providing core functionalities and libraries. This vulnerability affects the tarfile module, which is responsible for reading and writing tar archive files, a common format for file distribution.

Vulnerability Detail

The vulnerability identified as CVE-2025-8194 arises from a defect in the CPython tarfile module, specifically affecting the TarFile extraction and entry enumeration APIs. The flaw allows the processing of tar archives with negative offsets without generating an error, leading to an infinite loop and potential deadlock during the parsing of maliciously crafted tar archives. This could result in denial of service, as the application may become unresponsive when attempting to handle such archives.

How To Fix

Minimum fixed version

2.7.6-8ubuntu0.6+esm26

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python2.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can mitigate the risk by avoiding the extraction of untrusted tar archives. Additionally, a patch can be applied after importing the tarfile module to prevent the infinite loop. The following code snippet demonstrates how to implement the patch:

import tarfile

def patched_open(name, mode='r', **kwargs):
# Custom implementation to handle negative offsets
    return tarfile.TarFile.open(name, mode, **kwargs)

Replace the original open method with the patched one

tarfile.open = patched_open

Conclusion

CVE-2025-8194 poses a significant risk to applications utilizing the affected Python packages due to its potential to cause denial of service. It is crucial for users to update their packages to the patched versions and implement the suggested workarounds to secure their applications against this vulnerability.

See every vulnerability recorded for python2.7 →

Share this vulnerability

FAQ

CVE-2025-8194 is a vulnerability in the Python tarfile module that can lead to an infinite loop and denial of service when processing malicious tar archives.

The vulnerability affects multiple Python versions, including python2.7, python3.4, python3.5, python3.6, python3.7, python3.8, python3.9, python3.10, python3.11, and python3.13.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score for CVE-2025-8194 is 7.5, indicating a high severity level.

If immediate updates are not possible, avoid extracting untrusted tar archives and consider applying the provided workaround to mitigate risks.

Related vulnerabilities

Recent vulnerabilities recorded for python2.7.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.7.6-8ubuntu0.6+esm26

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python2.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback