CVE-2026-23968: Copier safe template has arbitrary filesystem read access via symlinks when _preserve_symlinks: false
(updated )
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 include arbitrary files/directories outside the local template clone location by using symlinks along with _preserve_symlinks: false (which is Copier’s default setting).
Imagine, e.g., a malicious template author who creates a template that reads SSH keys or other secrets from well-known locations and hopes for a user to push the generated project to a public location like github.com where the template author can extract the secrets.
Reproducible example:
- Illegally include a file in the generated project via symlink resolution:
echo "s3cr3t" > secret.txt
mkdir src/
pushd src/
ln -s ../secret.txt stolen-secret.txt
popd
uvx copier copy src/ dst/
cat dst/stolen-secret.txt
References
Code Behaviors & Features
Detect and mitigate CVE-2026-23968 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →