Project pdm.toml can run attacker code when PDM starts
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-94.
Summary
PDM from 2.27.0 before 2.29.8 lets a project's pdm.toml override the global-only cache_dir setting, an improper control of code generation issue (CWE-94). A malicious repository checkout can then control the plugin directory, and its .pth files run Python code as the invoking user when PDM starts, even for pdm --version. An attacker needs a victim to run PDM in the crafted checkout, and the plugin directory must match the checkout path and Python version. This bypasses the earlier fix for CVE-2026-47781.
Written with Claude Haiku 5.5 from the sources below · 2026-12-03
Description from the CNA
PDM is a Python package and dependency manager. From 2.27.0 until 2.29.8, a repository-controlled pdm.toml can override the global_only setting cache_dir because src/pdm/project/config.py enforces the restriction on writes but not when project configuration is read. In src/pdm/project/core.py, Project.config gives the project value precedence and project_plugins_dir is computed beneath the resulting cache directory. During Core.__init__ in src/pdm/core.py, load_plugins calls site.addsitedir on that directory's site-packages, processing executable .pth import lines before argument parsing. A malicious checkout can therefore execute Python code as the invoking user when PDM runs, including for pdm --version, if the prepared plugin directory matches the checkout path and Python version and PDM_CACHE_DIR is not set. This bypasses the earlier relocation of project plugins out of the checkout for CVE-2026-47781. This issue is fixed in version 2.29.8.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pdm-project | pdm | 2.27.0 to before 2.29.8 | 2.29.8 | Patch available | CNA |
- pdm Vendorpdm-project Affected 2.27.0 to before 2.29.8 Fixed in 2.29.8 Patch available CNA
Remediation
Upgrade pdm-project pdm to version 2.29.8, which fixes the issue.
Written with Claude Haiku 5.5 from the sources below · 2026-12-03
- Fix · CNA pdm (pdm-project) Fixed in 2.29.8
Timeline
- 2026-12-02 Threatist record created from CVE-2026-141547
- 2026-12-02 CISA SSVC decision points changed
References
More pdm-project vulnerabilities
- TI-2026-35274 pdm: Project-Controlled `.pdm-plugins` Content Executes Before CLI Parsing CVSS 4.0HIGH 8.4
- TI-2026-35260 pdm: Project-Local State and Config Writes Follow Symlinks CVSS 4.0MEDIUM 6.8
- TI-2026-35261 pdm: Path traversal in wheel installation via overridden write_to_fs CVSS 4.0HIGH 8.4
- TI-2026-103957 Code execution in PDM via project-controlled .pdm-python file CVSS 4.0HIGH 8.5
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences