{"answers":{"affected":"3 open source packages ship an affected version, including pdm.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-47781 exists.","fix":"Upgrade pdm to 2.27.0 or later.","what":"CVE-2026-47781 is a high-severity code injection vulnerability in pdm-project pdm, published on 4 Aug 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2026-47781 and fix it if it is affected.\n\nWhat it is: CVE-2026-47781 is a high-severity code injection vulnerability in pdm-project pdm, published on 4 Aug 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-47781 exists.\n\nAffected packages and fixed versions:\n- pdm (PyPI): affected all versions; fixed in 2.27.0\n- pdm (PyPI): affected all versions; fixed in 2.27.0\n- pdm (PyPI): affected all versions; fixed in 2.27.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-47781/ (Markdown: https://insights.sbomify.com/CVE-2026-47781/index.md)","id":"CVE-2026-47781","markdown":"https://insights.sbomify.com/CVE-2026-47781/index.md","name":"CVE-2026-47781","record":{"aliases":["DEBIAN-CVE-2026-47781","GHSA-qq6c-99pv-prvf","PYSEC-2026-2863","UBUNTU-CVE-2026-47781"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Python package manager","requires_auth":"none","summary":"Attackers can execute arbitrary Python code via malicious project-local plugins in untrusted repositories, affecting developers and CI systems using PDM.","user_interaction":"required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":8.4,"severity":"high","source":"cna","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","version":"4.0"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"},{"id":"CWE-829","name":"Inclusion of Functionality from Untrusted Control Sphere"}],"description":"PDM is a Python package and dependency manager. In versions up to and including 2.26.9, PDM automatically loads project-local plugins from a .pdm-plugins directory during initialization, allowing an attacker-controlled file in an untrusted repository checkout to execute arbitrary Python code before any command is parsed. This happens because load_plugins() runs during Core.init() and adds .pdm-plugins via site.addsitedir(), which processes .pth files and immediately executes any line beginning with import, so the code runs with the privileges of the user invoking pdm and even a benign command such as pdm --version triggers it (making the impact strongest in CI, automation, and privileged contexts). The issue is fixed in version 2.27.0.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"pdm: Project-Controlled `.pdm-plugins` Content Executes Before CLI Parsing","id":"CVE-2026-47781","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2026"},"n_packages":3,"n_references":2,"next":{"headline":"Other in Android App \"RoboForm Password Manager\"","id":"CVE-2026-47782"},"packages":[{"ecosystem":"PyPI","fixed":["2.27.0"],"introduced":["0"],"last_affected":[],"package":"pdm","purl":null,"source":"GHSA-qq6c-99pv-prvf"},{"ecosystem":"PyPI","fixed":["2.27.0"],"introduced":["0"],"last_affected":[],"package":"pdm","purl":"pkg:pypi/pdm","source":"GHSA-qq6c-99pv-prvf"},{"ecosystem":"PyPI","fixed":["2.27.0"],"introduced":["0"],"last_affected":[],"package":"pdm","purl":"pkg:pypi/pdm","source":"PYSEC-2026-2863"}],"prev":{"headline":"free5GC: UDR Improper ueId validation in free5GC EE subscription handlers allows arbitrary identifier persistence","id":"CVE-2026-47780"},"products":["pdm"],"published":"2026-08-04","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-08-05","vendors":["pdm-project"]},"summary":"Attackers can execute arbitrary Python code via malicious project-local plugins in untrusted repositories, affecting developers and CI systems using PDM.","url":"https://insights.sbomify.com/CVE-2026-47781/"}