CVE-2025-55214
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-08-18

Last updated on: 2025-08-18

Assigner: GitHub, Inc.

Description
Copier library and CLI app for rendering project templates. From 7.1.0 to before 9.9.1, 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 files outside the destination path where a project shall be generated or updated. This is possible when rendering a generated directory structure whose rendered path is either a relative parent path or an absolute path. Constructing such paths is possible using Copier's builtin pathjoin Jinja filter and its builtin _copier_conf.sep variable, which is the platform-native path separator. 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. This vulnerability is fixed in 9.9.1.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-08-18
Last Modified
2025-08-18
Generated
2026-05-07
AI Q&A
2025-08-18
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
copier copier 7.1.0
copier copier 9.9.1
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
Attack-Flow Graph
AI Powered Q&A
How can this vulnerability impact me? :

This vulnerability can impact you by allowing malicious Copier templates to write or overwrite files outside the intended project directory. If exploited, it can lead to unauthorized modification of arbitrary files on your filesystem, limited only by your user permissions. This can cause data loss, corruption, or disruption of system or application files, potentially leading to system instability or other harmful effects. The attack requires local access and some user interaction but does not require elevated privileges. [2]


Can you explain this vulnerability to me?

CVE-2025-55214 is a vulnerability in the Copier library and CLI app used for rendering project templates. It occurs because Copier allows templates that are considered "safe" to write files outside the intended destination directory. This happens when a template uses path constructions that resolve to parent directories or absolute paths outside the target folder, exploiting Copier's built-in Jinja filter `pathjoin` and the platform-native path separator variable. As a result, a malicious template author can craft templates that overwrite arbitrary files on the filesystem within the user's write permissions, potentially causing damage or disruption. This vulnerability affects Copier versions from 7.1.0 up to but not including 9.9.1 and is fixed in version 9.9.1. [1, 2]


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by checking if Copier templates are attempting to write files outside the intended destination directory using relative parent paths or absolute paths. Specifically, look for templates using the Jinja filter `pathjoin` combined with `_copier_conf.sep` to construct paths like '..' or absolute paths. Since the vulnerability involves unauthorized file writes outside the project directory, you can monitor file system changes outside expected directories during Copier runs. There are no explicit commands provided in the resources, but you can audit Copier template files for usage of `pathjoin('..', ...)` or absolute paths, and monitor file system writes outside the project directory during template rendering. [2]


What immediate steps should I take to mitigate this vulnerability?

The immediate mitigation is to upgrade Copier to version 9.9.1 or later, where the vulnerability is fixed by enforcing strict path validation to prevent writing outside the destination directory. Until upgrading, avoid using untrusted or unsafe templates, especially those that might use `pathjoin` to escape the project directory. Additionally, do not run Copier with Python optimizations (`python -O`), as this disables assertions that help prevent absolute path escapes. Monitoring and restricting write permissions can also help limit the impact. [1, 2]


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart