Arbitrary Filesystem Write Vulnerability in Jython and Python Packages
Summary
CVE-2025-4517: Allows arbitrary filesystem writes outside the extraction directory during extraction with filter="data". Affects python3 across 9 version ranges.
< 3.11.13-r0
< 9c1110ef6652687d7c55f590f909720eddde965a
< 9e0ac76d96cf80b49055f6d6b9a6763fb9215c2a
< 19de092debb3d7e832e5672cc2f7b788d35951da
< 3612d8f51741b11f36f8fb0494d79086bac9390a
< 4633f3f497b1ff70e4a35b6fe2c907cbe2d4cb2e
< 28463dba112af719df1e8b0391c46787ad756dd9
< aa9eb5f757ceff461e6e996f12c89e5d9b583b01
< dd8f187d0746da151e0025c51680979ac5b4cfb1
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
The Jython package is an implementation of the Python programming language that runs on the Java platform, allowing seamless integration of Java and Python code. The tarfile module in Python is used for reading and writing tar archive files. This vulnerability affects versions of Jython and Python that utilize the tarfile module to extract untrusted tar archives, particularly when using the filter parameter.
Vulnerability Detail
CVE-2025-4517 allows arbitrary filesystem writes outside the extraction directory during extraction with filter="data". This vulnerability arises when the tarfile module is used to extract untrusted tar archives with the filter parameter set to 'data' or 'tar'. Only Python versions 3.12 and later are affected, with Python 3.14 changing the default filter value to 'data', increasing the risk for users relying on this behavior. The vulnerability does not significantly affect the installation of source distributions, but caution is advised when evaluating such distributions.
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 with the tarfile module. Instead, use the default behavior without filtering, or ensure that the tar archives being extracted are from trusted sources.
Conclusion
CVE-2025-4517 presents a serious risk for users of Jython and Python packages that utilize the tarfile module for extracting untrusted tar archives. Users are encouraged to update their packages to patched versions and to exercise caution when handling tar archives.
See every vulnerability recorded for python3 →
FAQ
CVE-2025-4517 is a vulnerability that allows arbitrary filesystem writes outside the extraction directory when using the tarfile module in Python and Jython.
Only Python versions 3.12 and later are affected by this vulnerability, with Python 3.14 changing the default filter value to 'data'.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring access to the code.
If immediate updates are not possible, avoid using the filter parameter when extracting tar archives and ensure that the archives are from trusted sources.
While this vulnerability does not significantly affect the installation of source distributions, caution is advised when evaluating such distributions with suspicious links.
References
Related vulnerabilities
Recent vulnerabilities recorded for python3.