CVE-2025-4138

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 tarfilemodule 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. Only Python versions 3.12 or later are affected by these vulnerabilities, earlier versions don't include the extraction filter feature.

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.
Path Traversal
ProviderTypeBase ScoreAtk. VectorAtk. ComplexityPriv. RequiredVector
NISTNIST
7.5 HIGH
NETWORK
LOW
NONE
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
PSFCNA
7.5 HIGH
NETWORK
LOW
NONE
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
CISA-ADPADP
---
---
Awaiting analysis
This vulnerability is currently awaiting analysis.
Base Score
CVSS 3.x
EPSS Score
Percentile: 27%
Debian logo
Debian Releases
Debian Product
Codename
jython
bullseye
not-affected
bookworm
no-dsa
sid
vulnerable
trixie
vulnerable
python2.7
bullseye
vulnerable
bookworm
no-dsa
python3.11
bookworm
no-dsa
bullseye
not-affected
bookworm (security)
vulnerable
python3.12
sid
vulnerable
bullseye
not-affected
bookworm
no-dsa
python3.13
trixie
vulnerable
bullseye
not-affected
bookworm
no-dsa
sid
3.13.4-1
fixed
python3.9
bullseye
3.9.2-1
not-affected
bookworm
no-dsa
bullseye (security)
3.9.2-1+deb11u3
fixed
Ubuntu logo
Ubuntu Releases
Ubuntu Product
Codename
python2.7
plucky
dne
oracular
dne
noble
dne
jammy
needs-triage
focal
needs-triage
bionic
needs-triage
xenial
needs-triage
trusty
needs-triage
python3.10
plucky
dne
oracular
dne
noble
dne
jammy
needs-triage
python3.11
plucky
dne
oracular
dne
noble
dne
jammy
needs-triage
python3.12
plucky
dne
oracular
needs-triage
noble
needs-triage
jammy
dne
python3.13
plucky
needs-triage
oracular
needs-triage
noble
dne
jammy
dne
python3.4
plucky
dne
oracular
dne
noble
dne
jammy
dne
trusty
needs-triage
python3.5
plucky
dne
oracular
dne
noble
dne
jammy
dne
xenial
needs-triage
trusty
needs-triage
python3.6
plucky
dne
oracular
dne
noble
dne
jammy
dne
bionic
needs-triage
python3.7
plucky
dne
oracular
dne
noble
dne
jammy
dne
bionic
needs-triage
python3.8
plucky
dne
oracular
dne
noble
dne
jammy
dne
focal
needs-triage
bionic
needs-triage
python3.9
plucky
dne
oracular
dne
noble
dne
jammy
dne
focal
needs-triage