{"id":"CVE-2026-23986","published":"2026-01-21T22:20:37Z","modified":"2026-01-22T16:49:26Z","title":"Copier safe template has arbitrary filesystem write access via directory symlinks when _preserve_symlinks: true","vendor":"copier-org","product":"copier","tier":"tail","description":{"text":"Copier is a library and CLI app for rendering project templates. Prior to version 9.11.2, Copier suggests that it's safe to generate a project from a safe template, i.e. one that doesn't use unsafe features like custom Jinja extensions which would require passing the `--UNSAFE,--trust` flag. As it turns out, a safe template can currently write to arbitrary directories outside the destination path by using directory a symlink along with `_preserve_symlinks: true` and a generated directory structure whose rendered path is inside the symlinked directory. This way, a malicious template author can create a template that overwrites arbitrary files (according to the user's write permissions), e.g., to cause havoc. Version 9.11.2 patches the issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.9,"severity":"MEDIUM","version":"4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00277,"percentile":0.12773,"provenance":"source"},"cwes":[{"id":"CWE-61","name":"UNIX Symbolic Link (Symlink) Following"}],"references":[{"url":"https://github.com/copier-org/copier/security/advisories/GHSA-4fqp-r85r-hxqh","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/copier-org/copier/commit/b3a7b3772d17cf0e7a4481978188c9f536c8d8f6","tags":["x_refsource_MISC"]},{"url":"https://github.com/copier-org/copier/releases/tag/v9.11.2","tags":["x_refsource_MISC"]}],"priority":{"score":7.4,"factors":[{"name":"EPSS percentile","points":2.55},{"name":"CVSS severity","points":4.83}]},"vendorSlug":"copier-org","affectedVersions":[{"vendor":"copier-org","product":"copier","versions":["< 9.11.2"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-01-22T15:10:50.987653Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"copier","vulnerableRanges":["<9.11.2"],"patched":["9.11.2"],"from":["GHSA-4fqp-r85r-hxqh","PYSEC-2026-1272"],"provenance":"source"}],"summary":{"text":"The flaw lies in Copier, the library and CLI for rendering project templates, where a template marked as safe can write files outside the destination directory when it uses a directory symlink together with _preserve_symlinks: true and a generated directory structure whose rendered path falls inside the symlinked directory. An attacker who supplies a malicious template can overwrite any file that the user has write permission to, and this requires local access with the user interacting by generating a project from the template, with no authentication needed and no --UNSAFE/--trust flag.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:08:50Z"},"euvd":{"id":"EUVD-2026-4141","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2025-55201","published":"2025-08-18","fixed":"9.9.1","kev":false},{"cve":"CVE-2025-55214","published":"2025-08-18","fixed":"9.9.1","kev":false,"link":{"from":"CVE-2025-55214","to":"CVE-2026-23986","relation":"successor","confidence":"high","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:copier","fromFixed":"9.9.1","toFixed":"9.11.2","daysApart":156},{"kind":"same-code","provenance":"machine","files":["copier/_main.py"],"commits":["https://github.com/copier-org/copier/commit/fdbc0167cc22780b497e4db176feaf6f024757d6","https://github.com/copier-org/copier/commit/b3a7b3772d17cf0e7a4481978188c9f536c8d8f6"],"basis":"shared file"}]}},{"cve":"CVE-2026-23968","published":"2026-01-21","fixed":"9.11.2","kev":false},{"cve":"CVE-2026-23986","published":"2026-01-21","fixed":"9.11.2","kev":false},{"cve":"CVE-2026-34726","published":"2026-04-02","fixed":"9.14.1","kev":false,"link":{"from":"CVE-2026-23986","to":"CVE-2026-34726","relation":"successor","confidence":"high","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:copier","fromFixed":"9.11.2","toFixed":"9.14.1","daysApart":71},{"kind":"same-code","provenance":"machine","files":["copier/_main.py"],"commits":["https://github.com/copier-org/copier/commit/b3a7b3772d17cf0e7a4481978188c9f536c8d8f6","https://github.com/copier-org/copier/commit/cb80a3ffc9c3787de3ed837e04ca29a0ff8ca3df"],"basis":"shared file"}]}},{"cve":"CVE-2026-34730","published":"2026-04-02","fixed":"9.14.1","kev":false,"link":{"from":"CVE-2026-23986","to":"CVE-2026-34730","relation":"successor","confidence":"high","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:copier","fromFixed":"9.11.2","toFixed":"9.14.1","daysApart":71},{"kind":"same-code","provenance":"machine","files":["copier/_main.py"],"commits":["https://github.com/copier-org/copier/commit/b3a7b3772d17cf0e7a4481978188c9f536c8d8f6","https://github.com/copier-org/copier/commit/5413062eb17b73dc885f5e645cdc161e69ef641b"],"basis":"shared file"}]}},{"cve":"CVE-2026-53951","published":"2026-07-08","fixed":"9.15.2","kev":false}],"package":"PyPI:copier"}}