CVE-2024-12718

NameCVE-2024-12718
DescriptionAllows modifying some file metadata (e.g. last modified) with filter="data" or file permissions (chmod) with filter="tar" of files outside the extraction directory. 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. 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.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
jython (PTS)bullseye2.7.2+repack1-3fixed
bookworm, sid, trixie2.7.3+repack1-1fixed
python2.7 (PTS)bullseye2.7.18-8+deb11u1fixed
python3.11 (PTS)bookworm3.11.2-6+deb12u6fixed
bookworm (security)3.11.2-6+deb12u3fixed
python3.12 (PTS)sid3.12.10-1vulnerable
python3.13 (PTS)trixie3.13.3-2vulnerable
sid3.13.5-2fixed
python3.9 (PTS)bullseye3.9.2-1fixed
bullseye (security)3.9.2-1+deb11u3fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
jythonsource(unstable)(not affected)
python2.7source(unstable)(not affected)
python3.11source(unstable)(not affected)
python3.12source(unstable)(unfixed)
python3.13source(unstable)3.13.4-1
python3.9source(unstable)(not affected)

Notes

- python3.11 <not-affected> (Vulnerable code introduced in 3.12)
- python3.9 <not-affected> (Vulnerable code introduced in 3.12)
- python2.7 <not-affected> (Vulnerable code introduced in 3.12)
- jython <not-affected> (Vulnerable code introduced in 3.12)
https://github.com/python/cpython/issues/135034
https://github.com/python/cpython/pull/135037
https://mail.python.org/archives/list/security-announce@python.org/thread/MAXIJJCUUMCL7ATZNDVEGGHUMQMUUKLG/
Fixed by: https://github.com/python/cpython/commit/3612d8f51741b11f36f8fb0494d79086bac9390a (main)
Fixed by: https://github.com/python/cpython/commit/9e0ac76d96cf80b49055f6d6b9a6763fb9215c2a (3.14)
Fixed by: https://github.com/python/cpython/commit/aa9eb5f757ceff461e6e996f12c89e5d9b583b01 (v3.13.4)
Fixed by: https://github.com/python/cpython/commit/19de092debb3d7e832e5672cc2f7b788d35951da (v3.12.11)

Search for package or bug name: Reporting problems