Description
Copier is a library and CLI app for rendering project templates. Prior to version 9.11.2, Copier suggests that it's safe to generate a project from a safe template, i.e. one that doesn't use unsafe features like custom Jinja extensions which would require passing the `--UNSAFE,--trust` flag. As it turns out, a safe template can currently write to arbitrary directories outside the destination path by using directory a symlink along with `_preserve_symlinks: true` and a generated directory structure whose rendered path is inside the symlinked directory. This way, a malicious template author can create a template that overwrites arbitrary files (according to the user's write permissions), e.g., to cause havoc. Version 9.11.2 patches the issue.
Published: 2026-01-21
Score: 6.9 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Arbitrary File Write
Action: Apply Patch
AI Analysis

Impact

The vulnerability lies in Copier's handling of safe templates that can exploit directory symlinks when _preserve_symlinks: true. An attacker who can author a template can use a symlinked directory to write files outside the intended destination, effectively overwriting any file the user has permission to modify. This allows arbitrary file creation or modification, potentially compromising configuration files, binaries, or other sensitive resources.

Affected Systems

The flaw affects all installations of the Copier library and command‑line application produced by the copier‑org organization running versions prior to 9.11.2. The affected product is the Copier tool; any version older than 9.11.2 is vulnerable.

Risk and Exploitability

With a CVSS score of 6.9 the vulnerability is of moderate severity and is unlikely to be widely exploited, as the EPSS score is less than 1% and it is not listed in the CISA KEV catalog. Attackers must supply or control a template; once the malicious template is rendered, contamination occurs in the context of the user running Copier, impacting any files the user can write. The risk includes data tampering, credential leakage, or the introduction of exploitable code if overridden files are later executed.

Generated by OpenCVE AI on April 18, 2026 at 04:05 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the Copier tool to version 9.11.2 or later, which contains the fix.
  • If an upgrade cannot be performed, avoid using _preserve_symlinks: true with templates from untrusted or unknown authors; require that templates be obtained only from trusted sources or validate template paths prior to rendering.
  • Restrict the filesystem permissions of the user executing Copier so that only the necessary files and directories are writable; this limits the potential damage from a malicious template.

Generated by OpenCVE AI on April 18, 2026 at 04:05 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-4fqp-r85r-hxqh Copier safe template has arbitrary filesystem write access via directory symlinks when _preserve_symlinks: true
History

Mon, 02 Feb 2026 14:15:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:copier-org:copier:*:*:*:*:*:python:*:*
Metrics cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H'}


Fri, 23 Jan 2026 16:45:00 +0000

Type Values Removed Values Added
First Time appeared Copier-org
Copier-org copier
Vendors & Products Copier-org
Copier-org copier

Thu, 22 Jan 2026 23:00:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Wed, 21 Jan 2026 22:30:00 +0000

Type Values Removed Values Added
Description Copier is a library and CLI app for rendering project templates. Prior to version 9.11.2, Copier suggests that it's safe to generate a project from a safe template, i.e. one that doesn't use unsafe features like custom Jinja extensions which would require passing the `--UNSAFE,--trust` flag. As it turns out, a safe template can currently write to arbitrary directories outside the destination path by using directory a symlink along with `_preserve_symlinks: true` and a generated directory structure whose rendered path is inside the symlinked directory. This way, a malicious template author can create a template that overwrites arbitrary files (according to the user's write permissions), e.g., to cause havoc. Version 9.11.2 patches the issue.
Title Copier safe template has arbitrary filesystem write access via directory symlinks when _preserve_symlinks: true
Weaknesses CWE-61
References
Metrics cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

Copier-org Copier
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-01-22T16:49:26.426Z

Reserved: 2026-01-19T18:49:20.656Z

Link: CVE-2026-23986

cve-icon Vulnrichment

Updated: 2026-01-22T15:10:52.135Z

cve-icon NVD

Status : Analyzed

Published: 2026-01-21T23:15:52.793

Modified: 2026-02-02T14:10:51.063

Link: CVE-2026-23986

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-18T04:15:05Z

Weaknesses