Arbitrary Filesystem Write Vulnerability in Python3 Package

python3 Updated 02 Oct 2025

Summary

03/06/2025
N/A
Yes i
Unrated
Not published

ALPINE-CVE-2025-4517: Allows arbitrary filesystem writes outside the extraction directory during extraction with filter="data". Affects python3 versions < 3.11.13-r0. Fixed in 3.11.13-r0. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Python3 is a widely used programming language known for its simplicity and versatility. It includes a tarfile module that allows users to read and write tar archives. However, this module has a vulnerability that can lead to arbitrary filesystem writes when extracting untrusted tar archives, particularly when using specific extraction filters.

Vulnerability Detail

The vulnerability arises from the tarfile module's handling of extraction filters. When using TarFile.extractall() or TarFile.extract() with the filter parameter set to 'data' or 'tar', it allows arbitrary filesystem writes outside the designated extraction directory. This can lead to unauthorized access or modification of files on the system. The issue is particularly concerning for users relying on the default filter setting, which changed in Python 3.14 from 'no filtering' to 'data'. This change increases the risk for applications that extract untrusted tar archives.

How To Fix

Minimum fixed version

3.11.13-r0

This is the first release that contains the fix.

sudo apk add --upgrade python3

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

Workaround

As a temporary workaround, avoid using the filter parameter when extracting tar archives, or ensure that the archives being extracted are from trusted sources. Additionally, consider implementing file system access controls to limit the potential impact of this vulnerability.

Conclusion

The arbitrary filesystem write vulnerability in the Python3 package poses a significant risk when extracting untrusted tar archives. Users are advised to update to the patched versions of the package and implement workarounds until they can ensure their systems are secure.

See every vulnerability recorded for python3 →

Share this vulnerability

FAQ

The vulnerability allows arbitrary filesystem writes when extracting untrusted tar archives using specific filters.

Versions of Python3 in Alpine v3.19, v3.20, v3.21, and v3.22 are affected by this vulnerability.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

If immediate updates are not possible, avoid using the filter parameter and ensure that the tar archives are from trusted sources.

Vulert is a tool that monitors and alerts in real-time for open-source vulnerabilities in software using just a manifest file like package-lock.json.

Related vulnerabilities

Recent vulnerabilities recorded for python3.

How To Fix

Minimum fixed version

3.11.13-r0

This is the first release that contains the fix.

sudo apk add --upgrade python3

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

Follow Vulert in Google

Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.