CVE-2026-23986: Copier True Vulnerability

MODERATE
Advisory Identifier: GHSA-4fqp-r85r-hxqh
CVSS 7.1
CWE-61
Published
Advisory Summary

CVE-2026-23986 is a MODERATE (CVSS 7.1) true vulnerability (CWE-61: UNIX Symbolic Link (Symlink) Following) affecting Copier libraries in the PyPI ecosystem. The issue involves true. Remediation is available by upgrading affected packages to version 9.11.2.

CVE-2026-23986 at a Glance

CVE Identifier CVE-2026-23986
GHSA Identifier GHSA-4fqp-r85r-hxqh
Severity MODERATE
CVSS v3.1 Base Score 7.1
CWE Classification CWE-61: UNIX Symbolic Link (Symlink) Following
Affected Product Copier
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-23986

To remediate this vulnerability, upgrade all affected Copier dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

copier fixed: 9.11.2
pip install copier>=9.11.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show copier

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-23986, inspect your installed packages using pip:

pip show copier

Analyze the terminal output to locate any version of Copier in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.11.2), your application is affected.

Note: The pip show copier command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-61: UNIX Symbolic Link (Symlink) Following, where the product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. this could allow an attacker to cause the product to operate on unauthorized files. In Copier, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Copier suggests that it's safe to generate a project from a safe template, i.e. one that doesn't use [unsafe](https://copier.readthedocs.io/en/stable/configuring/#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`](https://copier.readthedocs.io/en/stable/configuring/#preserve_symlinks) and a [generated directory structure](https://copier.readthedocs.io/en/stable/configuring/#generating-a-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. > [!NOTE] > > At the time of writing, the exploit is non-deterministic, as Copier walks the template's file tree using [`os.scandir`](https://docs.python.org/3/library/os.html#os.scandir) which yields directory entries in arbitrary order. Reproducible example (may or may not work depending on directory entry yield order): ```shell mkdir other/ pushd other/ echo "sensitive" > sensitive.txt popd mkdir src/ pushd src/ ln -s ../other other echo "overwritten" > "{{ pathjoin('other', 'sensitive.txt') }}.jinja" echo "_preserve_symlinks: true" > copier.yml tree . # . # ├── copier.yml # ├── other -> ../other # └── {{ pathjoin('other', 'sensitive.txt') }}.jinja # # 1 directory, 2 files popd uvx copier copy --overwrite src/ dst/ cat other/sensitive.txt # overwritten ``` ### Patches n/a ### Workarounds n/a ### References n/a

CVE-2026-23986 Affected Copier Versions

1 component(s)
Fixed Versions:
9.11.2
Product / Package Ecosystem Affected Versions Fixed Version
copier
PyPI
< 9.11.2
9.11.2

References

Frequently Asked Questions

What is CVE-2026-23986?
CVE-2026-23986 is a security vulnerability in Copier involving true under CWE-61: UNIX Symbolic Link (Symlink) Following.
Which Copier versions are affected?
Affected versions include releases prior to 9.11.2 across affected packages: copier.
What version fixes CVE-2026-23986?
Upgrading to 9.11.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is copier affected?
Yes, copier is affected in releases prior to 9.11.2. Upgrade your dependency to 9.11.2 or later.
What is the CVSS score of CVE-2026-23986?
CVE-2026-23986 has a CVSS v3.1 base score of 7.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H.
What CWE is associated with CVE-2026-23986?
CVE-2026-23986 is classified under CWE-61: UNIX Symbolic Link (Symlink) Following (The product, when opening a file or directory, does not sufficiently account for when the file is a symbolic link that resolves to a target outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.).
How can I check PyPI dependencies for CVE-2026-23986?
Run the dependency tree command: 'pip show copier'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4fqp-r85r-hxqh",
  "modified" : "2026-02-02T16:33:53Z",
  "published" : "2026-01-21T22:19:29Z",
  "aliases" : [ "CVE-2026-23986" ],
  "summary" : "Copier safe template has arbitrary filesystem write access via directory symlinks when _preserve_symlinks: true ",
  "details" : "### Impact\n\nCopier suggests that it's safe to generate a project from a safe template, i.e. one that doesn't use [unsafe](https://copier.readthedocs.io/en/stable/configuring/#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`](https://copier.readthedocs.io/en/stable/configuring/#preserve_symlinks) and a [generated directory structure](https://copier.readthedocs.io/en/stable/configuring/#generating-a-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.\n\n> [!NOTE]\n>\n> At the time of writing, the exploit is non-deterministic, as Copier walks the template's file tree using [`os.scandir`](https://docs.python.org/3/library/os.html#os.scandir) which yields directory entries in arbitrary order.\n\nReproducible example (may or may not work depending on directory entry yield order):\n\n```shell\nmkdir other/\npushd other/\necho \"sensitive\" > sensitive.txt\npopd\n\nmkdir src/\npushd src/\nln -s ../other other\necho \"overwritten\" > \"{{ pathjoin('other', 'sensitive.txt') }}.jinja\"\necho \"_preserve_symlinks: true\" > copier.yml\ntree .\n# .\n# ├── copier.yml\n# ├── other -> ../other\n# └── {{ pathjoin('other', 'sensitive.txt') }}.jinja\n#\n# 1 directory, 2 files\npopd\n\nuvx copier copy --overwrite src/ dst/\n\ncat other/sensitive.txt\n# overwritten\n```\n\n### Patches\n\nn/a\n\n### Workarounds\n\nn/a\n\n### References\n\nn/a",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "copier"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "9.11.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/copier-org/copier/security/advisories/GHSA-4fqp-r85r-hxqh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-23986"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/copier-org/copier/commit/b3a7b3772d17cf0e7a4481978188c9f536c8d8f6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/copier-org/copier"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/copier-org/copier/releases/tag/v9.11.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-61" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-21T22:19:29Z",
    "nvd_published_at" : "2026-01-21T23:15:52Z"
  }
}