CVE-2026-34726Medium· 4.4▾ SunlitCopier `_subdirectory` allows template root escape via parent-directory traversal
▾ Sunlit zone — Low / medium · no exploitation signal
impact 24.2 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 13.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via OSV
Last analysed / modified upstream
0.4%
Copier's _subdirectory setting is documented as the subdirectory to use as the template root. However, the current implementation accepts parent-directory traversal such as .. and uses it directly when selecting the template root.
As a result, a template can escape its own directory and make Copier render files from the parent directory without --UNSAFE.
The relevant code path is:
_subdirectorytemplate_copy_root returns self.template.local_abspath / subdirRelevant code:
The effective sink is:
subdir = self._render_string(self.template.subdirectory) or ""
return self.template.local_abspath / subdir
There is no check that the resulting path stays inside the template directory.
The documentation for _subdirectory describes it as:
Subdirectory to use as the template root when generating a project.
and explains it as a way to separate template metadata from template source code:
That description fits values like template or poetry, but not ...
_subdirectory: .. escapes to the parent directorymkdir -p root/template dst
echo 'loot' > root/loot.txt
printf '%s\n' '_subdirectory: ..' > root/template/copier.yml
copier copy --overwrite root/template dst
find dst -maxdepth 3 -type f | sort
cat dst/loot.txt
Expected output includes:
dst/loot.txt
dst/template/copier.yml
loot
This shows Copier is rendering from root/ rather than from root/template/.
If a user runs Copier on an untrusted template, that template can change the effective template root and make Copier render files from outside the intended template directory.
Practical impact:
..--UNSAFEcopier < 9.14.1Upgrade to a patched release:
copier 9.14.1Connected by shared product, vendor, weakness, or advisory.
CVE-2026-34730Medium· 5.5Copier `_external_data` allows path traversal and absolute-path local file read without unsafe mode
CVE-2026-53951HighCopier has a trust-prefix bypass via path traversal that runs tasks unprompted
CVE-2026-23968Medium· 5.5Copier safe template has arbitrary filesystem read access via symlinks when _preserve_symlinks: false
CVE-2025-55214MediumCopier's safe template has filesystem write access outside destination path
CVE-2026-23986High· 7.1Copier safe template has arbitrary filesystem write access via directory symlinks when _preserve_symlinks: true
CVE-2025-55201HighCopier's safe template has arbitrary filesystem read/write access