CVE-2026-53951 Copier: trust-prefix bypass via path traversal runs tasks unprompted
Attackers can bypass trust checks via path traversal in Copier templates to execute arbitrary commands without user prompts.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-53951?
CVE-2026-53951 is a high-severity path traversal vulnerability in copier-org copier, published on 8 Jul 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
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.
Which versions are affected by CVE-2026-53951?
3 open source packages ship an affected version, including copier.
| Package | Affected | Fixed in |
|---|---|---|
copier PyPI | From 9.5.0 | 9.15.2 |
copier PyPI | From 9.5.0 | 9.15.2 |
copier PyPI | From 9.5.0 | 9.15.2 |
How do I fix CVE-2026-53951?
Upgrade copier to 9.15.2 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2026-53951 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-53951 exists.
Sources
Also known as GHSA-9gmc-jqmh-3rvm, PYSEC-2026-3818.