{"id":"CVE-2025-55214","published":"2025-08-18T16:36:46Z","modified":"2025-08-18T19:47:31Z","title":"Copier safe template has filesystem write access outside destination path","vendor":"copier-org","product":"copier","tier":"tail","description":{"text":"Copier library and CLI app for rendering project templates. From 7.1.0 to before 9.9.1, 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 files outside the destination path where a project shall be generated or updated. This is possible when rendering a generated directory structure whose rendered path is either a relative parent path or an absolute path. Constructing such paths is possible using Copier's builtin pathjoin Jinja filter and its builtin _copier_conf.sep variable, which is the platform-native path separator. 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. This vulnerability is fixed in 9.9.1.","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.00298,"percentile":0.14818,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://github.com/copier-org/copier/security/advisories/GHSA-p7q8-grrj-3m8w","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/copier-org/copier/commit/fdbc0167cc22780b497e4db176feaf6f024757d6","tags":["x_refsource_MISC"]}],"priority":{"score":7.8,"factors":[{"name":"EPSS percentile","points":2.96},{"name":"CVSS severity","points":4.83}]},"vendorSlug":"copier-org","affectedVersions":[{"vendor":"copier-org","product":"copier","versions":[">= 7.1.0, < 9.9.1"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-08-18T19:46:44.392978Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"copier","vulnerableRanges":[">=7.1.0, <9.9.1"],"patched":["9.9.1"],"from":["GHSA-p7q8-grrj-3m8w","PYSEC-2026-1273"],"provenance":"source"}],"euvd":{"id":"EUVD-2025-25131","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-copier-org-copier-cve-2025-55214","children":[{"from":"CVE-2025-55214","to":"CVE-2026-34730","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["copier/_main.py","copier/errors.py"],"commits":["https://github.com/copier-org/copier/commit/fdbc0167cc22780b497e4db176feaf6f024757d6","https://github.com/copier-org/copier/commit/5413062eb17b73dc885f5e645cdc161e69ef641b"],"basis":"shared function","functions":["__init__"]}]}],"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},{"cve":"CVE-2026-23968","published":"2026-01-21","fixed":"9.11.2","kev":false,"link":{"from":"CVE-2025-55214","to":"CVE-2026-23968","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-23986","published":"2026-01-21","fixed":"9.11.2","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-34726","published":"2026-04-02","fixed":"9.14.1","kev":false}],"package":"PyPI:copier"}}