CVE-2026-141547

7.0High

Published Dec 2, 2026 · NVD status: Received · AI triage by gemini-3.1-flash-lite

7.0CVSS

High

0CVSS v3.110

Attack vector
Local
Complexity
High
Privileges
None
User action
Required
Impact
Full C/I/A compromise
Weakness
CWE-15, CWE-94

What an attacker gets

An attacker can execute arbitrary Python code as the current user by placing a malicious .pth file in a project directory. This occurs when a user runs PDM commands inside a compromised repository.

Root cause

The application incorrectly trusts project-level configuration to set the cache directory, which allows loading malicious plugins from untrusted paths during initialization.

Affected versions

PDM 2.27.0 through 2.29.7

CVSS v3.1 · CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Fix & remediation

Upgrade to PDM 2.29.8 or later. As a workaround, set the PDM_CACHE_DIR environment variable to a trusted, absolute path to prevent the project-controlled directory from being used.

remediation — bash
$ pip install --upgrade pdm

AI-suggested. Run it in staging first and check it against the vendor advisory. Why?

NVD description

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.

References

Source: nvd.nist.gov/vuln/detail/CVE-2026-141547

More fully triaged vulnerabilities you may want to check next.