Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-34726 — copier

🟡 CVSS 4.4 — Medium ⚠️ Exploit Public CWE-22 OSV
4.4
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Copier _subdirectory allows template root escape via parent-directory traversal

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:

1. the template defines _subdirectory

2. Copier renders that string

3. template_copy_root returns self.template.local_abspath / subdir

4. 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:

```python

subdir = self._render_string(self.template.subdirectory) or ""

return self.template.local_abspath / subdir

```

There 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

```sh

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

```

Expected output includes:

```text

dst/loot.txt

dst/template/copier.yml

loot

```

This 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

How this vulnerability can be exploited

This issue can be reached with local access to the system, attack complexity is low, an attacker needs no privileges on the target. A user must be tricked into taking some action. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality low, integrity low, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

  • Attack vector: Local — a local account, shell or session on the host is needed.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: Required — someone has to click, open or visit something.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: Low — limited, and the attacker does not choose what is affected.
  • Integrity impact: Low — limited, and the attacker does not choose what is affected.
  • Availability impact: None.

Weakness class

CVE-2026-34726 is classified as CWE-22: Path Traversal. A file path built from user input is not confined to the intended directory, letting an attacker reach files elsewhere on the filesystem.

Affected software

CVE-2026-34726 is recorded against 1 package.

  • copier (fixed in 9.14.1)

Timeline and source

Published on 2 April 2026 and last revised on 24 July 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Advisory)
github.com (Fix)
github.com (Evidence)

Other advisories for this package

copier has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-22: Path Traversal) in other software:

Details

Severity MEDIUM
CVSS Score 4.4
CVSS Vector CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
CWE CWE-22
Public Exploit ⚠️ Yes
Source OSV
Published 2026-04-02
Updated 2026-08-20
Modified 2026-07-24

Affected Packages

Software From version Fixed in
copier 9.14.1

Similar Threats

Exploit Protection

Are you running copier?

CVE-2026-34726 carries CVSS 4.4 Medium rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-34726 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026