Update dependency copier to v9.11.2 [SECURITY]#17
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
Conversation
382abb0 to
2df019a
Compare
2df019a to
d1d8c31
Compare
d1d8c31 to
53176a5
Compare
53176a5 to
a221653
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==9.2.0→==9.11.2GitHub Vulnerability Alerts
CVE-2025-55201
Impact
Copier's current security model shall restrict filesystem access through Jinja:
{% include ... %}, which is limited by Jinja to reading files from the subtree of the local template clone in our case.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,--trustflag. As it turns out, a safe template can currently read and write arbitrary files because we expose a fewpathlib.Pathobjects in the Jinja context which have unconstrained I/O methods. This effectively renders our security model w.r.t. filesystem access useless.Arbitrary read access
Imagine, e.g., a malicious template author who creates a template that reads SSH keys or other secrets from well-known locations, perhaps "masks" them with Base64 encoding to reduce detection risk, and hopes for a user to push the generated project to a public location like github.com where the template author can extract the secrets.
Reproducible example:
Read known file:
Read unknown file(s) via globbing:
Arbitrary write access
Imagine, e.g., a malicious template author who creates a template that overwrites or even deletes files to cause havoc.
Reproducible examples:
Overwrite known file:
Overwrite unknown file(s) via globbing:
Delete unknown file(s) via globbing:
Delete unknown files and directories via tree walking:
CVE-2025-55214
Impact
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,--trustflag. 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 builtinpathjoinJinja filter and its builtin_copier_conf.sepvariable, 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.Write access via generated relative path
Reproducible example:
Write access via generated absolute path
Reproducible example:
POSIX:
Windows (PowerShell):
This scenario is slightly less severe, as Copier has a few assertions of the destination path being relative which would typically be raised. But
python -O(orPYTHONOPTIMIZE=x) removes asserts, so these guards may be ineffective. In addition, this scenario will prompt for overwrite confirmation or require the--overwriteflag for non-interactive mode; yet malicious file writes might go unnoticed.CVE-2026-23968
Impact
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,--trustflag. As it turns out, a safe template can currently include arbitrary files/directories outside the local template clone location by using symlinks along with_preserve_symlinks: false(which is Copier's default setting).Imagine, e.g., a malicious template author who creates a template that reads SSH keys or other secrets from well-known locations and hopes for a user to push the generated project to a public location like github.com where the template author can extract the secrets.
Reproducible example:
Illegally include a file in the generated project via symlink resolution:
Illegally include a directory in the generated project via symlink resolution:
Patches
n/a
Workarounds
n/a
References
n/a
CVE-2026-23986
Impact
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,--trustflag. 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: trueand 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.Note
At the time of writing, the exploit is non-deterministic, as Copier walks the template's file tree using
os.scandirwhich yields directory entries in arbitrary order.Reproducible example (may or may not work depending on directory entry yield order):
Patches
n/a
Workarounds
n/a
References
n/a
Release Notes
copier-org/copier (copier)
v9.11.2Compare Source
Fix
(#2427)
Security
v9.11.1Compare Source
Fix
_copier_confvariable
v9.11.0Compare Source
Feat
clean (#2369)
Fix
chmodis not allowedRefactor
v9.10.3Compare Source
Fix
excluded paths
_excludelist in new template version whenupdating
v9.10.2Compare Source
Fix
v9.10.1Compare Source
Fix
v9.10.0Compare Source
Feat
copier.yml(#2251)Fix
v9.9.1Compare Source
Security
pathlib.PurePathv9.9.0Compare Source
Feat
Fix
core.fsmonitor=true(#2151)v9.8.0Compare Source
Feat
:current:for referring to the current templateref
Fix
_copier_conf.answers_filevia Jinjacontext hook
v9.7.1Compare Source
Refactor
_toolsinstead oftoolsv9.7.0Compare Source
Feat
TaskErrorexception on task errorsInteractiveSessionErrorwhen prompting in non-interactive environmentFix
<CONFIG_ROOT>/copieras settings directory on Windows (#2071)when: falsequestionsRefactor
_prefixv9.6.0Compare Source
Feat
_copier_operationvariable (#1733)_copier_phasecontext variableFix
--data-file$fileif$file.tmplexists when subdirectory is usedRefactor
v9.5.0Compare Source
Feat
defaultsvalues (fix #235)Fix
.gitignorefile(#1886)
v9.4.1Compare Source
Fix
preserve_symlinks: falsefor directories (#1820)v9.4.0Compare Source
Fix
--skip-answeredis usedRefactor
keep_trailing_newlinemore idiomaticallyPerf
v9.3.1Compare Source
Fix
--skip-tasksflag to worker (#1688)v9.3.0Compare Source
Feat
Fix
defaultlist items for multi-select choice questionsConfiguration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.