# 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.

- **Severity:** High 8.8 (`CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H`)
- **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:** Yes
- **Published:** 8 Jul 2026
- **Updated:** 9 Jul 2026
- **Also known as:** GHSA-9gmc-jqmh-3rvm, PYSEC-2026-3818

## 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.

Weakness: CWE-94 (Improper Control of Generation of Code), CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-53951?

3 open source packages ship an affected version, including copier.


| Package | Ecosystem | 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.

## Is CVE-2026-53951 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-53951 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-53951 and fix it if it is affected.

What it is: 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.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-53951 exists.

Affected packages and fixed versions:
- copier (PyPI): affected from 9.5.0; fixed in 9.15.2
- copier (PyPI): affected from 9.5.0; fixed in 9.15.2
- copier (PyPI): affected from 9.5.0; fixed in 9.15.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-53951/ (Markdown: https://insights.sbomify.com/CVE-2026-53951/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-53951
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-53951
- OSV: https://osv.dev/vulnerability/CVE-2026-53951

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-53951/
Summaries are generated and may contain mistakes; the official description above is the record.
