CVE-2026-47781: CWE-829: Inclusion of Functionality from Untrusted Control Sphere in pdm-project pdm
PDM, a Python package and dependency manager, versions up to and including 2.26.9 automatically load project-local plugins from a .pdm-plugins directory during initialization. This behavior allows an attacker-controlled file in an untrusted repository checkout to execute arbitrary Python code before any command is parsed. The vulnerability arises because the load_plugins() function runs during Core.init() and adds .pdm-plugins via site.addsitedir(), which processes .pth files and executes import lines immediately. This code execution occurs with the privileges of the user running pdm, affecting even benign commands like pdm --version. The issue is fixed in version 2.27.0.
AI Analysis
Technical Summary
CVE-2026-47781 affects pdm-project's pdm tool, a Python package and dependency manager. In versions <=2.26.9, pdm automatically loads plugins from a .pdm-plugins directory during initialization by using site.addsitedir(), which processes .pth files and executes any import statements immediately. This allows an attacker who can place files in an untrusted repository checkout to execute arbitrary Python code with the privileges of the user invoking pdm. The vulnerability is triggered even by benign commands such as 'pdm --version', making it particularly impactful in automated or privileged environments. The vulnerability is classified under CWE-829 (Inclusion of Functionality from Untrusted Control Sphere) and CWE-94 (Code Injection). The issue is resolved in pdm version 2.27.0.
Potential Impact
An attacker with the ability to place files in a repository checkout can execute arbitrary Python code with the privileges of the user running pdm. This can lead to unauthorized code execution in local or automated environments such as CI pipelines. The vulnerability is triggered before any command parsing, including by non-destructive commands like 'pdm --version', increasing the risk in automated or privileged contexts.
Mitigation Recommendations
Upgrade pdm to version 2.27.0 or later, where this vulnerability is fixed. Until then, avoid running pdm commands in untrusted repository checkouts or environments where attacker-controlled files may exist. Patch status is confirmed fixed in version 2.27.0.
CVE-2026-47781: CWE-829: Inclusion of Functionality from Untrusted Control Sphere in pdm-project pdm
Description
PDM, a Python package and dependency manager, versions up to and including 2.26.9 automatically load project-local plugins from a .pdm-plugins directory during initialization. This behavior allows an attacker-controlled file in an untrusted repository checkout to execute arbitrary Python code before any command is parsed. The vulnerability arises because the load_plugins() function runs during Core.init() and adds .pdm-plugins via site.addsitedir(), which processes .pth files and executes import lines immediately. This code execution occurs with the privileges of the user running pdm, affecting even benign commands like pdm --version. The issue is fixed in version 2.27.0.
CVSS v4.0
Score 8.4high
Affected software
pdm-project
pdm
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-47781 affects pdm-project's pdm tool, a Python package and dependency manager. In versions <=2.26.9, pdm automatically loads plugins from a .pdm-plugins directory during initialization by using site.addsitedir(), which processes .pth files and executes any import statements immediately. This allows an attacker who can place files in an untrusted repository checkout to execute arbitrary Python code with the privileges of the user invoking pdm. The vulnerability is triggered even by benign commands such as 'pdm --version', making it particularly impactful in automated or privileged environments. The vulnerability is classified under CWE-829 (Inclusion of Functionality from Untrusted Control Sphere) and CWE-94 (Code Injection). The issue is resolved in pdm version 2.27.0.
Potential Impact
An attacker with the ability to place files in a repository checkout can execute arbitrary Python code with the privileges of the user running pdm. This can lead to unauthorized code execution in local or automated environments such as CI pipelines. The vulnerability is triggered before any command parsing, including by non-destructive commands like 'pdm --version', increasing the risk in automated or privileged contexts.
Mitigation Recommendations
Upgrade pdm to version 2.27.0 or later, where this vulnerability is fixed. Until then, avoid running pdm commands in untrusted repository checkouts or environments where attacker-controlled files may exist. Patch status is confirmed fixed in version 2.27.0.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-19T22:36:16.883Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a7237f0bf8831d539488332
Added to database: 08/04/2026, 19:05:20 UTC
Last enriched: 08/12/2026, 15:48:05 UTC
Last updated: 09/18/2026, 10:01:31 UTC
Views: 53
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.