CVE-2025-4138
Bypassing extraction filter to create symlinks to arbitrary targets outside extraction directory
A public proof of concept exists; no exploitation attested.
- Published2025-06-03
- Fixed in3.13.4 · 3.12.11 · 3.11.13 · 3.10.18 · 3.9.23
- WeaknessCWE-22
Am I affected?
Debian, Ubuntu or Red Hat sometimes backport a fix without changing the upstream version number: such a version reads « to verify », never « affected ».With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.
Description
Allows the extraction filter to be ignored, allowing symlink targets to point outside the destination directory, and the modification of some file metadata. You are affected by this vulnerability if using the tarfile module to extract untrusted tar archives using TarFile.extractall() or TarFile.extract() using the filter= parameter with a value of "data" or "tar". See the tarfile extraction filters documentation https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter for more information. Note that for Python 3.14 or later the default value of filter= changed from "no filtering" to `"data", so if you are relying on this new default behavior then your usage is also affected. Note that none of these vulnerabilities significantly affect the installation of source distributions which are tar archives as source distributions already allow arbitrary code execution during the build process. However when evaluating source distributions it's important to avoid installing source distributions with suspicious links.
Timeline
dates in UTC- 2025-06-0313:15CVE publishedNVD
Versions per branch
OSV| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 3.13 | ≥ 3.13.0, < 3.13.4 | 3.13.4 | OSV |
| 3.12 | ≥ 3.12.0, < 3.12.11 | 3.12.11 | OSV |
| 3.11 | ≥ 3.11.0, < 3.11.13 | 3.11.13 | OSV |
| 3.10 | ≥ 3.10.0, < 3.10.18 | 3.10.18 | OSV |
| 3.9 | < 3.9.23 | 3.9.23 | OSV |
| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 3.13 | ≥ 3.13.0, < 3.13.4 | 3.13.4 | OSV |
| 3.12 | ≥ 3.12.0, < 3.12.11 | 3.12.11 | OSV |
| 3.11 | ≥ 3.11.0, < 3.11.13 | 3.11.13 | OSV |
| 3.10 | ≥ 3.10.0, < 3.10.18 | 3.10.18 | OSV |
| 3.9 | < 3.9.23 | 3.9.23 | OSV |
| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 3.13 | ≥ 3.13.0, < 3.13.4 | 3.13.4 | OSV |
| 3.12 | ≥ 3.12.0, < 3.12.11 | 3.12.11 | OSV |
| 3.11 | ≥ 3.11.0, < 3.11.13 | 3.11.13 | OSV |
| 3.10 | ≥ 3.10.0, < 3.10.18 | 3.10.18 | OSV |
| 3.9 | < 3.9.23 | 3.9.23 | OSV |
as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.
Products declared by the CNA1 product
As PSF, the CNA that assigned this CVE, declared them in the CVE record; versions as written.
- Python Software Foundation CPythonother versions: not affected
https://github.com/python/cpython
Affected- < 3.9.23fixed in 3.9.23python
- ≥ 3.10.0, < 3.10.18fixed in 3.10.18python
- ≥ 3.11.0, < 3.11.13fixed in 3.11.13python
- ≥ 3.12.0, < 3.12.11fixed in 3.12.11python
- ≥ 3.13.0, < 3.13.4fixed in 3.13.4python
- ≥ 3.14.0a1, < 3.14.0b3fixed in 3.14.0b3python
Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2026-07-31
Distribution builds and vendor advisories
Packages from OSV.dev and products from the vendors' CSAF advisories.
version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.
Packages
- cassandraCleanStartall versions · fixed in 5.0.6-r2and 1 other package
- cassandra-fipsCleanStartall versions · fixed in 4.0.19-r3
- cassandra-fipsCleanStartall versions · fixed in 4.1.10-r2
- CythonRocky Linux:8all versions · fixed in 0:0.29.21-5.module+el8.10.0+1582+bc278001
- CythonRocky Linux:8all versions · fixed in 0:0.29.21-5.module+el8.10.0+1860+afcc1c71
- CythonRed Hat:enterprise_linux:8::crball versions · fixed in 0:0.29.21-5.module+el8.9.0+19644+d68f775dand 3 other packages
- kserve-storage-controllerCleanStartall versions · fixed in 0.19.0-r0
- mod_wsgiRocky Linux:8all versions · fixed in 0:4.7.1-7.module+el8.10.0+1582+bc278001
310 more package ranges on OSV.dev
Vendor advisories
cpython: python: Bypassing extraction filter to create symlinks to arbitrary targets outside extraction directory
Siemens SINEC OS
RUGGEDCOM RST2428P (6GK6242-6PA00) · SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family · SCALANCE XCH328 (6GK5328-4TS01-2EC2) · +13 more
SSA-089022: Multiple Vulnerabilities in Third-Party Components in SINEC OS before V3.3
RUGGEDCOM RST2428P (6GK6242-6PA00) · SCALANCE XC-300/XR-300/XC-400/XR-500WG/XR-500 family · SCALANCE XCH328 (6GK5328-4TS01-2EC2) · +13 more
Red Hat Security Advisory: Release of OpenShift Serverless Logic 1.36.0 security update & enhancements
Red Hat Security Advisory: python39:3.9 security update
Red Hat Security Advisory: cert-manager Operator for Red Hat OpenShift 1.16.0
14 more advisories
Fix
- Update python to 3.13.4 · 3.12.11 · 3.11.13 · 3.10.18 · 3.9.23
- Vendor fix CISA ICSA-26-043-06 · 14 productsUpdate to V3.3 or later version
- Vendor fix CISA ICSA-26-043-06 · 1 productSee Section Additional Information.
- Vendor fix Siemens ProductCERT SSA-089022 · 14 productsUpdate to V3.3 or later version
- Vendor fix Siemens ProductCERT SSA-089022 · 1 productSee Section Additional Information.
- Vendor fix Red Hat Product Security RHSA-2026:0934 · 30 productsBefore applying this update, make sure all previously released errata relevant to your system have been applied. For details on how to apply this update, refer to: https://access.redhat.com/articles/11258
- Vendor fix Red Hat Product Security RHSA-2025:23530 · 229 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
Detection
read 2026-11-01 01:02 UTC- Nuclei template
- none so far ProjectDiscovery
- Exploit-DB
- no entry Exploit-DB
- Proof of concept
- PoC-in-GitHub5 repositories, unverifiedknown since 2026-11-01DesertDemons/CVE-2025-4138-4517-POCthefizzyfish/CVE-2025-4138_tarfile_filter_bypasskyakei/CVE-2025-4138-poclocalh0ste/CVE-2025-4138d3vn0mi/CVE-2025-4138-POC
- Metasploit modules
- none listed Metasploit Framework
Sources
- NVDCVE recordread 2026-10-23
- CISA-ADPSSVC decisionnone2025-06-03
- CNACVSS 3.17.5known since 2026-10-23
- CNAweakness (CWE)CWE-22known since 2026-10-23
- FIRST EPSSEPSS score1.5 %2026-11-09
- PoC-in-GitHubproof of concept5known since 2026-11-01
- OSVaffected packages—
- GitHub Advisoriesadvisory—
Identifiers
- AZL-62322same flawAzure Linux · MIT
- BIT-libpython-2025-4138same flawBitnami · Apache-2.0
- BIT-python-2025-4138same flawBitnami · Apache-2.0
- BIT-python-min-2025-4138same flawBitnami · Apache-2.0
- CGA-59p4-38hp-63fhsame flawChainguard · CC-BY-NC-ND-4.0
- CGA-w883-j9wg-xhm3same flawChainguard · CC-BY-NC-ND-4.0
- EUVD-2025-16724same flawENISA EUVD · LicenseRef-ENISA-legal-notice
- GHSA-4g4g-fqw4-prp2same flawGitHub Advisory Database · CC-BY-4.0
- MINI-5hmj-4xxq-vv53same flawMinimOS · LicenseRef-unstated
- MINI-82wx-m8p4-65x8same flawMinimOS · LicenseRef-unstated
- MINI-jf23-mhq6-mg9jsame flawMinimOS · LicenseRef-unstated
- MINI-w4p8-v8gg-27cqsame flawMinimOS · LicenseRef-unstated
- PSF-2025-6same flawPython Software Foundation · CC-BY-4.0
- ALSA-2025:10026advisory covering several CVEsAlmaLinux · MIT
- ALSA-2025:10031advisory covering several CVEsAlmaLinux · MIT
- ALSA-2025:10128advisory covering several CVEsAlmaLinux · MIT
- ALSA-2025:10136advisory covering several CVEsAlmaLinux · MIT
- ALSA-2025:10140advisory covering several CVEsAlmaLinux · MIT
- ALSA-2025:10148advisory covering several CVEsAlmaLinux · MIT
- ALSA-2025:10189advisory covering several CVEsAlmaLinux · MIT
- ALSA-2025:23530advisory covering several CVEsAlmaLinux · MIT
- MGASA-2025-0280advisory covering several CVEsMageia · LicenseRef-unstated
- OESA-2025-1789advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2025-1790advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2025-1791advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2025-2304advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2025-2305advisory covering several CVEsopenEuler · LicenseRef-unstated
- OESA-2025-2538advisory covering several CVEsopenEuler · LicenseRef-unstated
- RHSA-2025:10026advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:10028advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:10031advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:10128advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:10136advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:10140advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:10148advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:10189advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:10399advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:10484advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:10602advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:23530advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2025:9918advisory covering several CVEsRed Hat · CC-BY-4.0
- RLSA-2025:10026advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2025:10031advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2025:10128advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2025:10136advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2025:10140advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2025:10148advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2025:10189advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2025:23530advisory covering several CVEsRocky Linux · BSD-3-Clause
- SUSE-SU-2025:02047-1advisory covering several CVEsSUSE · LicenseRef-unstated
Technical details
- CVSS v3 Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Published
- 2025-06-03
- Last Modified
- 2026-07-31
- NVD status
- Deferred
- GitHub Advisory
- GHSA-4g4g-fqw4-prp2
Frequently asked questions
What is CVE-2025-4138?
Is CVE-2025-4138 actively exploited?
What is the CVSS score for CVE-2025-4138?
Running Python? Hear about its next vulnerability
Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».
No credit card required · No monthly cap on website lookups · 250 API requests/month
Go further
- Following what attackers exploit right now? The CISA KEV additions of the month, with their patch deadlines.
- Running this software? Vulnerability monitoring alerts you to new vulnerabilities in your products.
Related vulnerabilities
Same product first, then the same vendor advisory and the same publication week.
Sources for this record
- CISA ICS advisories (CSAF) · Public domain (US Government work)
- CVE Program · CVE Program Terms of Use
- ENISA EU Vulnerability Database · ENISA legal notice §1.2 (reproduction authorised, provided the source is acknowledged)
- FIRST EPSS · EPSS terms of use (free use, attribution requested)
- GitHub Advisory Database · CC-BY-4.0 · GHSA-4g4g-fqw4-prp2
- NVD · Public domain (17 U.S.C. § 105) for NVD-authored data; third-party content under its own terms
- OpenCVE · OpenCVE terms of service · terms restrict redistribution
- OSV.dev · Per record, as its publisher states it: each row carries the label in sourceLicense when one is served
- PoC-in-GitHub · CC0-1.0
- Red Hat Product Security (CSAF and VEX) · CC-BY-4.0
- Siemens ProductCERT (CSAF) · TLP:WHITE (commercial use and redistribution granted)
- CISA Vulnrichment · CC0-1.0