CVE-2026-23986CWE-61

Copier safe template has arbitrary filesystem write access via directory symlinks when _preserve_symlinks: true

Medium · published January 21, 2026

CVSS v4.0
6.9
EPSS
0%
Percentile
18.1
In the wild
Unconfirmed
What it is

⚠️ A clever trick can turn a "safe" project template into a file-wrecking machine! Prior to version 9.11.2, the Copier library allowed malicious templates to overwrite files outside the destination path. 🔥 Think of it like a seemingly harmless delivery driver who’s been given one address but secretly has a master key to other homes along the route. If they know how to exploit that, they can deliver chaos instead of just packages! An attacker could craft a template that, when rendered, overwrites critical files on the system — imagine your important documents suddenly vanishing or getting replaced with junk! This could lead to significant data loss and operational headaches for users.

Put simply

Think of it like a seemingly harmless delivery driver who’s been given one address but secretly has a master key to other homes along the route. If they know how to exploit that, they can deliver chaos instead of just packages! This vulnerability stems from Copier allowing symlinked directories to be used in template generation. When the `_preserve_symlinks` option is enabled, it can lead to unintended file overwrites if a malicious template is used, bypassing the intended safety measures.

What to do

An attacker could craft a template that, when rendered, overwrites critical files on the system — imagine your important documents suddenly vanishing or getting replaced with junk! This could lead to significant data loss and operational headaches for users. Upgrade to Copier version 9.11.2 immediately to patch this vulnerability. Additionally, always review templates for the use of symlinks and avoid using unverified templates to maintain a secure environment. You've got this! Secure your templates and keep that chaos at bay! 🛡️

The record
Technical detail
CVSS v4.0
6.9 · MEDIUM
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
EPSS
0.00270 · 18.1th percentile
Weakness
CWE-61 · UNIX Symbolic Link (Symlink) Following
Published
2026-01-21T22:20Z
EPSS history
Timeline
  • 21 JAN 22:20Z
    Copier safe template has arbitrary filesystem write access via directory symlinks when _preserve_symlinks: true
    cvelistv5