CVE-2026-53951
HighCVSS 8.8Exploitation Probability (EPSS)
Low risk19th percentile - higher than 19% of all known CVEs
Summary
A vulnerability in the Copier library (versions 9.5.0 through 9.15.1) allows bypassing the trust mechanism for templates. The prefix check uses raw `str.startswith` without path normalization, while template fetching normalizes the path, enabling `..` sequences to point to a different, attacker-controlled template. Consequently, code from `tasks`, `migrations`, or `jinja_extensions` executes without a trust prompt.
Risk Assessment
An attacker can achieve remote code execution on the victim's machine if the victim uses a trusted prefix and provides a crafted template URL. This could lead to full system compromise, data theft, or malware installation.
Recommendation
Immediately update Copier to version 9.15.2 or later. If updating is not possible, temporarily avoid using trusted prefixes or manually verify each template before use.
Other vulnerabilities in Copier
See all- CVE-2026-145570Medium
Copier version 8.0.0 before 9.17.2 contains an arbitrary file read vulnerability that allows malicious templates to read files outside the template root via symlinks followed by the Jinja FileSystemLoader. Attackers can ship a symlink, enable _preserve_symlinks, and reference it with an include tag to render credentials or SSH keys into generated projects without --trust.
- CVE-2026-62999High
Copier versions 9.5.0 through 9.16.0 contain a vulnerability that allows bypassing the trusted repository prefix. Percent-encoded path segments or separators in a template URL can match a configured trusted prefix before decoding by the HTTP server or Git transport, enabling unsafe template features from a repository outside the trusted prefix after user interaction.
- CVE-2026-34730Medium
Copier before version 9.14.1 has a vulnerability in the _external_data feature that allows a template to load YAML files from template-controlled paths. A malicious template can read local YAML-parseable files accessible to the user and expose their contents in rendered output.
- CVE-2026-34726Medium
Copier before version 9.14.1 accepts parent-directory traversal (..) in the _subdirectory setting, allowing a template to escape its own directory and render files from the parent directory without the --UNSAFE flag.
- CVE-2026-23968Medium
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 include arbitrary files/directories outside the local template clone location by using symlinks along with _preserve_symlinks: false (which is Copier's default setting). Version 9.11.2 patches the issue.
- CVE-2025-55214Medium
Copier library and CLI app versions 7.1.0 to before 9.9.1 allow a safe template to write files outside the destination path where a project is generated or updated. A malicious template author can use the builtin pathjoin Jinja filter and the _copier_conf.sep variable to create relative parent or absolute paths, overwriting arbitrary files according to the user's write permissions.
- CVE-2025-55201High
Copier library and CLI app for rendering project templates prior to 9.9.1 allows a safe template to read and write arbitrary files because Copier exposes pathlib.Path objects in the Jinja context with unconstrained I/O methods. This vulnerability is fixed in 9.9.1.
Original NVD description (English source)
Copier is a library and CLI app for rendering project templates. In versions 9.5.0 through 9.15.1, the `trust` setting's prefix match (`copier/_settings.py`) compares the template URL against a trusted prefix with a raw `str.startswith` and no path normalization, while the URL is normalized when the template is actually fetched (`Path.resolve()` for local paths; libcurl dot-segment removal for `https`). A template reference that textually starts with a trusted prefix but contains `..` is therefore granted trust yet resolves to a different, attacker-controlled template, whose `tasks` / `migrations` / `jinja_extensions` then run without the `--trust` prompt — arbitrary command execution. Version 9.15.2 patches the issue.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

