Critical Vulnerability in Python Tarfile Module: CVE-2025-8194

python2.7 Updated 02 Oct 2025

Summary

28/07/2025
N/A
No i
Unrated
Not published

CVE-2025-8194: There is a defect in the CPython “tarfile” module affecting the “TarFile” extraction and entry enumeration APIs. Affects python2.7 across 4 version ranges.

< 7040aa54f14676938970e10c5f74ea93cd56aa38 < c9d9f78feb1467e73fd29356c040bde1c104f29f < cdae923ffe187d6ef916c0f665a31249619193fe < fbc2a0ca9ac8aff6887f8ddf79b87b4510277227

No fix is published. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The Python programming language is widely used for various applications, including web development, data analysis, artificial intelligence, and more. The 'tarfile' module in Python allows for the reading and writing of tar archive files, which are commonly used for file compression and distribution. This module is essential for developers who need to handle tar files in their applications. However, a critical vulnerability has been identified in the tarfile module that affects its extraction and entry enumeration APIs, posing a significant risk to applications utilizing this functionality.

Vulnerability Detail

CVE-2025-8194 is a defect in the CPython 'tarfile' module that allows for the processing of tar archives with negative offsets without error. This flaw can lead to an infinite loop and deadlock during the parsing of maliciously crafted tar archives. If exploited, this vulnerability can cause applications to hang indefinitely, potentially leading to denial of service and impacting the availability of services relying on the affected Python versions.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, you can mitigate the vulnerability by applying a patch after importing the 'tarfile' module. The following code snippet demonstrates how to implement this patch:

import tarfile

Apply the patch to mitigate the vulnerability

(Insert patch code here)

For the specific patch details, refer to the following link: https://gist.github.com/sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1

Conclusion

CVE-2025-8194 is a critical vulnerability in the Python 'tarfile' module that can lead to severe consequences if exploited. It is essential for developers using affected Python versions to update their packages promptly or apply the provided workaround to mitigate the risk. Utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.

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 infinite loops and deadlocks when processing malicious tar archives.

The vulnerability affects Python 2.7, Python 3.9, Python 3.11, and Python 3.13 on Debian systems.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring any signup.

If immediate updates are not possible, apply the provided workaround to mitigate the vulnerability until you can upgrade to a patched version.

More information can be found in the official CVE database and the provided patch link: https://gist.github.com/sethmlarson/1716ac5b82b73dbcbf23ad2eff8b33e1.

Related vulnerabilities

Recent vulnerabilities recorded for python2.7.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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