In versions up to and including 2.26.9, PDM automatically loads project-local plugins from a .pdm-plugins directory during initialization, allowing… (CVE-2026-47781)
Description
PDM 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 with the privileges of the user running PDM. The vulnerability occurs because the load_plugins() function runs during Core.init() and adds the .pdm-plugins directory via site.addsitedir(), which processes .pth files and executes any import statements immediately. Even benign commands like 'pdm --version' trigger this code execution. The issue is fixed in version 2.27.0.
CVSS v4.0
Affected software
pkg:deb/ubuntu/pdm?arch=source&distro=stonkingpkg:deb/ubuntu/pdm?arch=source&distro=resoluteRun 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
PDM, a Python package and dependency manager, in versions up to and including 2.26.9, has a vulnerability where it automatically loads project-local plugins from a .pdm-plugins directory during initialization. This loading mechanism uses site.addsitedir(), which processes .pth files and executes any import statements found, leading to arbitrary Python code execution if an attacker controls files in the .pdm-plugins directory of an untrusted repository checkout. This code runs with the privileges of the user invoking PDM and is triggered even by simple commands such as 'pdm --version'. The vulnerability is resolved in version 2.27.0.
Potential Impact
An attacker who can place files in the .pdm-plugins directory of a project 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, especially impacting continuous integration (CI) systems or privileged contexts. The vulnerability is triggered during initialization before any command parsing, increasing the risk of exploitation.
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 that may contain malicious .pdm-plugins directories. There is no indication that other mitigations or workarounds are provided by the vendor.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- UBUNTU-CVE-2026-47781
- Osv Schema Version
- 1.7.0
- Ecosystems
- ["Ubuntu:26.10","Ubuntu:26.04:LTS"]
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6ad3f6312cdf04f656664f08
Added to database: 10/17/2026, 22:26:57 UTC
Last enriched: 10/18/2026, 01:08:22 UTC
Last updated: 10/18/2026, 01:08:22 UTC
Views: 3
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.