Listen to this Post
Copier is a tool for generating projects from templates, often used with Jinja2. By default, it operates with _preserve_symlinks set to false, which means symbolic links in templates are resolved during the copy process. This vulnerability allows a safe template—one that doesn’t require the –UNSAFE flag—to include symlinks pointing to files or directories outside the template’s clone location. When Copier processes such a template, it dereferences these symlinks, copying the target contents into the generated project. This bypasses the intended safety measures for trusted templates. An attacker can craft a malicious template with symlinks to sensitive system files, such as SSH keys in ~/.ssh/id_rsa or passwords in /etc/shadow. Upon execution, Copier follows the symlinks, embedding the sensitive data into the output. If the user then publishes this project to a public repository like GitHub, the attacker can retrieve the secrets. The issue stems from inadequate access control during symlink resolution in safe mode, effectively granting arbitrary filesystem read access under default settings.
Platform: Copier
Version: All versions
Vulnerability: Symlink traversal read
Severity: Moderate
Date: Jan 21 2026
Prediction: Patch TBD
What Undercode Say:
Analytics:
Create symlink in template
ln -s /etc/passwd template/passwd_link
Copier config example
_preserve_symlinks: false
Process template
copier copy template/ output/
Symlink resolved, file copied
How Exploit:
Attacker embeds symlinks.
User runs copier copy.
Sensitive files included.
User publishes project.
Attacker extracts secrets.
Protection from this CVE:
Set _preserve_symlinks true.
Use trusted templates only.
Audit before publishing.
Impact:
Unauthorized file read.
Secret disclosure potential.
🎯Let’s Practice Exploiting & Learn Patching For Free:
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

