CVE-2026-141547
Received Received - Intake

Arbitrary Code Execution in PDM Python Package

Vulnerability report for CVE-2026-141547, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-12-02

Last updated on: 2026-12-02

Assigner: GitHub, Inc.

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-12-02
Last Modified
2026-12-02
Generated
2026-12-03
AI Q&A
2026-12-03
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
pdm_project pdm From 2.27.0 (inc) to 2.29.8 (exc)
pdm_project pdm 2.29.8

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
CWE-15 One or more system settings or configuration elements can be externally controlled by a user.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability in PDM (Python package manager) versions 2.27.0 to 2.29.8 allows a malicious repository to execute arbitrary Python code when PDM runs. It occurs because a project's pdm.toml file can override the cache_dir setting, which controls where plugins are loaded from. The code execution happens during PDM startup if the plugin directory matches the repository path and Python version, bypassing security measures that moved plugins out of the project directory.

Detection Guidance

Check for PDM versions between 2.27.0 and 2.29.7. Inspect pdm.toml files in project directories for cache_dir settings pointing to untrusted locations. Look for .pth files in cache directories that may execute arbitrary code during PDM startup.

Impact Analysis

If you run PDM in an untrusted repository checkout, an attacker could execute malicious code on your system with the same permissions as your user account. This could lead to data theft, system compromise, or further attacks within your environment. The attack requires the repository to guess your PDM installation path.

Compliance Impact

This vulnerability could lead to unauthorized code execution, potentially violating data protection requirements under GDPR or HIPAA by allowing access to sensitive data. Organizations using PDM in regulated environments may face compliance risks if attackers exploit this flaw to exfiltrate or manipulate protected information.

Mitigation Strategies

Upgrade PDM to version 2.29.8 or later. Remove any cache_dir settings from project pdm.toml files. Avoid running PDM in untrusted repository checkouts. Set PDM_CACHE_DIR to a trusted global directory if needed.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-141547. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart

Security Radar

News mentioning this vulnerability
Loading related security news...