Arbitrary Filesystem Write Vulnerability in Python3 Package
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for python3.
Follow Vulert in Google
Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.