CVE-2026-23986: Copier True Vulnerability
MODERATECVE-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
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).
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.
pip install copier>=9.11.2
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
CVE-2026-23986 Affected Copier Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
copier
|
PyPI |
< 9.11.2
|
9.11.2
|
References
Frequently Asked Questions
What is CVE-2026-23986?
Which Copier versions are affected?
What version fixes CVE-2026-23986?
Is copier affected?
What is the CVSS score of CVE-2026-23986?
What CWE is associated with CVE-2026-23986?
How can I check PyPI dependencies for CVE-2026-23986?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}