Skip to content

Path traversal in wheel installation via overridden write_to_fs (CWE-22)

High
frostming published GHSA-78v8-vpjp-cjqh May 21, 2026

Package

pip pdm (pip)

Affected versions

<= 2.22.4

Patched versions

2.27.0

Description

InstallDestination.write_to_fs() in src/pdm/installers/installers.py overrides the base class to add symlink/hardlink support but replaces the safe _path_with_destdir() (which validates via Path.resolve() + is_relative_to()) with a bare os.path.join() that performs no path validation. A malicious wheel with traversal entries can write arbitrary files. Same class as Poetry CVE-2026-34591. Fix ready at: https://github.com/ffulbtech/pdm/tree/fix/wheel-path-traversal

Severity

High

CVE ID

CVE-2026-47764

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.