Advisories for Pypi/Copier package

2026

Copier `_external_data` allows path traversal and absolute-path local file read without unsafe mode

Copier's _external_data feature allows a template to load YAML files using template-controlled paths. The documentation describes these values as relative paths from the subproject destination, so relative paths themselves appear to be part of the intended feature model. However, the current implementation also allows destination-external reads, including: Parent-directory paths such as ../secret.yml Absolute paths such as /tmp/secret.yml and then exposes the parsed contents in rendered output. This is possible without …

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

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 to arbitrary directories outside the destination path by using directory a symlink along with _preserve_symlinks: true and a generated directory structure whose rendered path is inside the symlinked directory. …

Copier safe template has arbitrary filesystem read access via symlinks when _preserve_symlinks: false

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 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 …

2025

Copier's safe template has filesystem write access outside destination path

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 …

Copier's safe template has arbitrary filesystem read/write access

Copier's current security model shall restrict filesystem access through Jinja: Files can only be read using {% include … %}, which is limited by Jinja to reading files from the subtree of the local template clone in our case. Files are written in the destination directory according to their counterparts in the template. Copier suggests that it's safe to generate a project from a safe template, i.e. one that doesn't …