{"id":"CVE-2026-23986","state":"PUBLISHED","title":"Copier safe template has arbitrary filesystem write access via directory symlinks when _preserve_symlinks: true","description":"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.","publishedAt":"2026-01-21T22:20:37.720Z","updatedAt":"2026-01-22T16:49:26.426Z","severity":{"score":6.9,"label":"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","source":"GitHub_M"},"assigner":"GitHub_M","products":["copier-org copier"],"affected":[{"vendor":"copier-org","product":"copier","versions":[{"version":"< 9.11.2","status":"affected"}]}],"references":["https://github.com/copier-org/copier/security/advisories/GHSA-4fqp-r85r-hxqh","https://github.com/copier-org/copier/commit/b3a7b3772d17cf0e7a4481978188c9f536c8d8f6","https://github.com/copier-org/copier/releases/tag/v9.11.2"],"weaknesses":["CWE-61"],"ingestedAt":"2026-10-29T20:11:21.040Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/23xxx/CVE-2026-23986.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-23986","state":"PUBLISHED","datePublished":"2026-01-21T22:20:37.720Z","dateUpdated":"2026-01-22T16:49:26.426Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-01-19T18:49:20.656Z"},"containers":{"cna":{"title":"Copier safe template has arbitrary filesystem write access via directory symlinks when _preserve_symlinks: true","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"copier-org","product":"copier","versions":[{"version":"< 9.11.2","status":"affected"}]}],"references":[{"url":"https://github.com/copier-org/copier/security/advisories/GHSA-4fqp-r85r-hxqh","name":"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","name":"https://github.com/copier-org/copier/commit/b3a7b3772d17cf0e7a4481978188c9f536c8d8f6","tags":["x_refsource_MISC"]},{"url":"https://github.com/copier-org/copier/releases/tag/v9.11.2","name":"https://github.com/copier-org/copier/releases/tag/v9.11.2","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV4_0":{"attackVector":"LOCAL","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"PASSIVE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"HIGH","vulnAvailabilityImpact":"HIGH","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","baseScore":6.9,"baseSeverity":"MEDIUM","vectorString":"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","version":"4.0"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-61","lang":"en","description":"CWE-61: UNIX Symbolic Link (Symlink) Following","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-01-21T22:20:37.720Z"},"source":{"advisory":"GHSA-4fqp-r85r-hxqh","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-01-22T15:10:50.987653Z","id":"CVE-2026-23986","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-01-22T16:49:26.426Z"}}]}}}