CVE-2026-141547: PDM: A project pdm.toml can still set cache_dir, which brings back project-controlled plugin code at pdm startup

Published Dec 2, 2026
·
Updated

PDM is a Python package and dependency manager. From 2.27.0 until 2.29.8, a repository-controlled pdm.toml can override the globalonly setting cachedir 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 projectpluginsdir is computed beneath the resulting cache directory. During Core.init in src/pdm/core.py, loadplugins 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 PDMCACHEDIR 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.

Affected Software

1 affected component
pypi/pdm>=2.27.0<2.29.8

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.29.8

Event History

Dec 2, 2026
CVE Published
via MITRE·06:58 PM
Data Sourced
via MITRE·06:58 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:18 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to exploitation?

Users running affected PDM versions from 2.27.0 through 2.29.7 in or against a malicious repository checkout are exposed. The code runs as the user invoking PDM, and even commands such as "pdm --version" can trigger it.

2

What conditions must an attacker satisfy?

The attacker needs to control a checkout containing a pdm.toml and prepare a plugin directory at the path derived from the overridden cache_dir and the relevant Python version. PDM_CACHE_DIR must not be set, and the prepared directory must contain site-packages content that causes executable .pth import lines to be processed.

3

Are default settings affected?

Yes. The described attack applies when PDM_CACHE_DIR is not set, because the repository-controlled cache_dir can then take precedence and influence the project plugin path.

4

What can be done before upgrading?

Set PDM_CACHE_DIR so the repository's cache_dir setting does not determine the plugin location, and avoid running PDM in untrusted checkouts. Upgrade to version 2.29.8 when possible.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203