{"id":"CVE-2026-47763","aliases":["CVE-2026-47763","GHSA-ghq2-5c67-fprm","PYSEC-2026-2862"],"related":[],"kind":"vulnerability","state":"published","title":"pdm: Project-Local State and Config Writes Follow Symlinks","summary":"pdm is a Python package and dependency manager supporting the latest PEP standards. In versions prior to 2.27.0, pdm writes several project-local state or configuration files without symlink protection. If a malicious repository places those files as symlinks, local PDM operations can overwrite the symlink targets. This creates an arbitrary file clobber primitive relative to the privileges of the invoking user. Config.__init__() resolves the project-local pdm.toml path and _save_config() writes to the resolved target. If PROJECT_ROOT/pdm.toml is a symlink to another file, pdm config -l ... updates the target file instead of refusing the write.\nThe same general problem exists for other project-local persistence paths that are written directly with no lstat / O_NOFOLLOW protection. For the pdm.toml PoC specifically, the target file must already contain parseable TOML. Otherwise the load step fails before the write path is reached. That parser constraint does not apply to the .pdm-python or .python-version sinks. This issue has been fixed in version 2.27.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"pdm is a Python package and dependency manager supporting the latest PEP standards. In versions prior to 2.27.0, pdm writes several project-local state or configuration files without symlink protection. If a malicious repository places those files as symlinks, local PDM operations can overwrite the symlink targets. This creates an arbitrary file clobber primitive relative to the privileges of the invoking user. Config.__init__() resolves the project-local pdm.toml path and _save_config() writes to the resolved target. If PROJECT_ROOT/pdm.toml is a symlink to another file, pdm config -l ... updates the target file instead of refusing the write.\nThe same general problem exists for other project-local persistence paths that are written directly with no lstat / O_NOFOLLOW protection. For the pdm.toml PoC specifically, the target file must already contain parseable TOML. Otherwise the load step fails before the write path is reached. That parser constraint does not apply to the .pdm-python or .python-version sinks. This issue has been fixed in version 2.27.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nPDM writes several project-local state or configuration files without symlink protection. If a malicious repository places those files as symlinks, local PDM operations can overwrite the symlink targets.\n\nThis creates an arbitrary file clobber primitive relative to the privileges of the invoking user.\n\n## Affected Behavior\n\n- Project-local config writes can affect files outside the repository\n- The most stable demonstrated sink is `pdm.toml`\n- Related sinks include `.pdm-python` and `.python-version`\n\n## Affected Code\n\n- `src/pdm/project/config.py:303-350`\n- `src/pdm/project/core.py:209-217`\n- `src/pdm/cli/commands/use.py:187-189`\n\n## Technical Details\n\n`Config.__init__()` resolves the project-local `pdm.toml` path and `_save_config()` writes to the resolved target. If `PROJECT_ROOT/pdm.toml` is a symlink to another file, `pdm config -l ...` updates the target file instead of refusing the write.\n\nThe same general problem exists for other project-local persistence paths that are written directly with no `lstat` / `O_NOFOLLOW` protection.\n\nFor the `pdm.toml` PoC specifically, the target file must already contain parseable TOML. Otherwise the load step fails before the write path is reached. That parser constraint does not apply to the `.pdm-python` or `.python-version` sinks.\n\n## Impact\n\n- Arbitrary file clobber as the invoking user\n- Destructive modification of local files outside the repository root\n- Useful primitive for privilege abuse when `pdm` is run in elevated contexts\n\n## Reproduction\n\nPoC:\n\n```bash\n# Replace this with a Python interpreter that can run `python -m pdm`.\nPDM_PY=/path/to/python-with-pdm\ntmpdir=$(mktemp -d)\ntarget=\"$tmpdir/clobbered-target.toml\"\n\ncat > \"$target\" <<'EOF'\n[seed]\nvalue = 1\nEOF\n\nln -s \"$target\" \"$tmpdir/pdm.toml\"\n\ncat > \"$tmpdir/pyproject.toml\" <<'EOF'\n[project]\nname = \"symlink-clobber-demo\"\nversion = \"0.0.1\"\nEOF\n\n(\n  cd \"$tmpdir\" &&\n  \"$PDM_PY\" -m pdm config -l venv.in_project false\n)\n\ncat \"$target\"\n```\n\nExpected result:\n\n- A temporary project is created\n- `pdm.toml` is a symlink to another TOML file\n- Running `pdm config -l venv.in_project false` modifies the symlink target\n\nObserved output from local validation:\n\n```text\n--- target ---\n[seed]\nvalue = 1\n\n[venv]\nin_project = false\n```\n\n## Severity\n\nMedium\n\n## CVSS v4.0\n\n- Base score: `6.8` (`Medium`)\n- Vector: `CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N`\n\nRationale:\n\n- `AV:L`: exploitation requires local execution of `pdm` against an attacker-prepared checkout\n- `AC:L`: there is no complex constraint once the symlink sink exists\n- `AT:N`: no extra prerequisite beyond the victim running the relevant command is required\n- `PR:N`: the attacker does not need prior privileges on the victim system\n- `UI:A`: the victim must actively run a command that writes project-local state or config\n- `VC:N`: the demonstrated issue is a write primitive, not a direct read primitive\n- `VI:H`: the attacker can cause unauthorized modification of files outside the repository root\n- `VA:L`: file clobber can disrupt local operation, but direct same-step availability impact is lower than a full RCE\n- `SC:N/SI:N/SA:N`: the base score is limited to the directly affected system\n\n## Root Cause\n\nProject-local file sinks are treated as trusted regular files and are written without symlink checks or guarded atomic replacement.\n\n## Recommended Remediation\n\n- Refuse to write project-local config/state files when the destination is a symlink\n- Use `lstat` and `O_NOFOLLOW` where available\n- Avoid resolving attacker-controlled project-local paths before writing\n- Use atomic temp-file replacement only after confirming the destination is a regular file\n\n## Disclosure Notes\n\nThis issue is independent from the code-execution issues above. It is best tracked as a separate CVE candidate because the root cause and remediation are different.","format":"markdown","source":"ghsa"},{"lang":"es","text":"pdm es un gestor de paquetes y dependencias de Python que soporta los últimos estándares PEP. En versiones anteriores a la 2.27.0, pdm escribe varios archivos de estado o configuración locales del proyecto sin protección contra enlaces simbólicos. Si un repositorio malicioso coloca esos archivos como enlaces simbólicos, las operaciones locales de PDM pueden sobrescribir los destinos de los enlaces simbólicos. Esto crea una primitiva de sobrescritura de archivos arbitraria relativa a los privilegios del usuario invocador. Config.__init__() resuelve la ruta local del proyecto pdm.toml y _save_config() escribe en el destino resuelto. Si PROJECT_ROOT/pdm.toml es un enlace simbólico a otro archivo, pdm config -l ... actualiza el archivo de destino en lugar de rechazar la escritura.\nEl mismo problema general existe para otras rutas de persistencia locales del proyecto que se escriben directamente sin protección lstat / O_NOFOLLOW. Para la PoC de pdm.toml específicamente, el archivo de destino ya debe contener TOML analizable. De lo contrario, el paso de carga falla antes de que se alcance la ruta de escritura. Esa restricción del analizador no se aplica a los sumideros .pdm-python o .python-version. Este problema ha sido solucionado en la versión 2.27.0.","source":"nvd"}],"published":"2026-06-10T20:32:56.000Z","modified":"2026-10-24T16:10:00.153Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N"}],"cwes":["CWE-61"],"affected":[{"ranges":[{"version":"<  2.27.0","status":"affected"}],"vendor":"pdm-project","product":"pdm","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.27.0"}],"ecosystem":"PyPI","package":"pdm","purl":"pkg:pypi/pdm","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.27.0"}],"ecosystem":"PyPI","package":"pdm","purl":"pkg:pypi/pdm","source":"pysec"}],"references":[{"url":"https://github.com/pdm-project/pdm/security/advisories/GHSA-ghq2-5c67-fprm","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pdm-project/pdm/releases/tag/2.27.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pdm-project/pdm","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/pdm","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-ghq2-5c67-fprm","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47763","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-08-05T15:00:17.473Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-47763","url":"https://www.cve.org/CVERecord?id=CVE-2026-47763","licence":"CVE Terms of Use","modified":"2026-08-05T15:00:39.192Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-ghq2-5c67-fprm","url":"https://github.com/advisories/GHSA-ghq2-5c67-fprm","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:31.635Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-47763","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-47763","licence":"Public domain","modified":"2026-10-24T16:10:00.153Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2862","url":"https://osv.dev/vulnerability/PYSEC-2026-2862","licence":"CC-BY-4.0","modified":"2026-07-13T16:32:55.793Z"}],"updatedAt":"2026-11-25T22:59:31.000Z","epss":{"score":0.00267,"percentile":0.20068,"date":"2026-12-01T12:00:22.000Z"}}