Executive brief
PDM is a Python package and dependency manager used by developers to install and manage software libraries. A vulnerability in its installation process allows a specially crafted malicious package (wheel) to write files to arbitrary locations on a user's computer. This could allow an attacker to overwrite sensitive system files or configuration settings when a user installs a compromised library.
Technical details
A path traversal vulnerability exists in PDM's installer due to an insecure override of the `InstallDestination.write_to_fs()` method in `src/pdm/installers/installers.py`. The implementation replaces the secure `_path_with_destdir()` validation (which uses `Path.resolve()` and `is_relative_to()`) with a bare `os.path.join()` call that lacks path validation. An attacker can exploit this by distributing a malicious Python wheel containing file paths with traversal sequences (e.g., `../../`). When a user installs the package, PDM will write files to arbitrary locations on the filesystem. The issue is addressed in version 2.27.0.
Affected products
- pdm-project pdm <= 2.22.4
Timeline
- 2026-05-21: disclosed
- 2026-05-21: patched: Fixed in version 2.27.0
- 2026-06-10: advisory