Python
CVE-2026-34726
MEDIUM
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Impact | CVSS 4.4 reflects low-to-moderate severity: attack vector is local (AV:L), attack complexity is low (AC:L), no privileges required (PR:N), but user interaction is required (UI:R-user must run copier on the template). Confidentiality and integrity impacts are low (C:L, I:L); no availability impact (A:N). EPSS and exploitation probability are not provided in input data, but the attack requires deliberate user execution of an untrusted template, limiting real-world frequency. KEV status is not confirmed, and no public exploit code is referenced, suggesting this is a logic flaw rather than an actively weaponized vector. However, the issue is practically exploitable without special flags (no --UNSAFE required), and any template repository or distribution channel could be compromised to embed this attack. For supply-chain risk (if copier templates are auto-installed), this becomes higher-impact; for manual template usage, risk is moderate. The straightforward PoC and absence of exploit protections make this a genuine priority for patching, despite the low CVSS score. |
| Exploit ScenarioDerived | An attacker creates a malicious Copier template repository and sets |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 01, 2026
Path traversal in Copier's _subdirectory setting allows template escape without --UNSAFE flag. A malicious or compromised template can use parent-directory traversal sequences (e.g., _subdirectory: ..) to render files from outside the intended template directory, enabling unauthorized file access during template instantiation. CVSS 4.4 (low-to-moderate severity); no public exploit code or active exploitation confirmed at time of analysis.
RemediationAI
Upgrade Copier to the patched version specified in the GitHub Security Advisory (GHSA-85v3-4m8g-hrh6). The fix implements path containment validation to ensure _subdirectory values cannot escape the template root using parent-directory traversal; this likely involves path normalization and assertion that the resolved path is a descendant of the template base directory. Immediate workaround: only run Copier on templates from trusted sources and manually audit _subdirectory values in copier.yml before execution. Review https://github.com/copier-org/copier/security/advisories/GHSA-85v3-4m8g-hrh6 for the exact patched release version and implementation details.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Copier is a Python-based template generation tool that processes a _subdirectory configuration parameter to set the effective template root directory. The vulnerability exists in the rendering pipeline: the _subdirectory string is rendered as a Jinja2 template, then appended directly to self.template.local_abspath without path normalization or containment validation. The sink is in _template.py where return self.template.local_abspath / subdir concatenates user-controlled subdirectory input to the base template path using Python's pathlib division operator. No check confirms the resolved path remains within the intended template boundary. This is a classic path traversal (CWE-22) where relative path components like .. are accepted and processed, allowing escape to parent directories. The vulnerability affects pkg:pip/copier across versions that do not implement path containment checks.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Primary rating from Vendor (https://github.com/copier-org/copier) · only source for this CVE.
CVSS VectorVendor: https://github.com/copier-org/copier
Lifecycle Timeline
2DescriptionCVE.org
Summary
Copier's _subdirectory setting is documented as the subdirectory to use as the template root. However, the current implementation accepts parent-directory traversal such as .. and uses it directly when selecting the template root.
As a result, a template can escape its own directory and make Copier render files from the parent directory without --UNSAFE.
Details
The relevant code path is:
- the template defines
_subdirectory - Copier renders that string
template_copy_rootreturnsself.template.local_abspath / subdir- Copier walks that directory as the template root
Relevant code:
- <https://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/copier/_main.py#L1056-L1062>
- <https://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/copier/_template.py#L504-L513>
The effective sink is:
subdir = self._render_string(self.template.subdirectory) or ""
return self.template.local_abspath / subdirThere is no check that the resulting path stays inside the template directory.
The documentation for _subdirectory describes it as:
> Subdirectory to use as the template root when generating a project.
and explains it as a way to separate template metadata from template source code:
<https://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/docs/configuring.md#L1582-L1646>
That description fits values like template or poetry, but not ...
PoC
PoC 1: _subdirectory: .. escapes to the parent directory
mkdir -p root/template dst
echo 'loot' > root/loot.txt
printf '%s\n' '_subdirectory: ..' > root/template/copier.yml
copier copy --overwrite root/template dst
find dst -maxdepth 3 -type f | sort
cat dst/loot.txtExpected output includes:
dst/loot.txt
dst/template/copier.yml
lootThis shows Copier is rendering from root/ rather than from root/template/.
Impact
If a user runs Copier on an untrusted template, that template can change the effective template root and make Copier render files from outside the intended template directory.
Practical impact:
- template-root escape via
.. - rendering of parent-directory files that were not meant to be part of the template
- possible without
--UNSAFE
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Affected Products (CPE)CVE.org
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
GHSA-85v3-4m8g-hrh6
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB