{"id":"CVE-2026-23968","aliases":["CVE-2026-23968","GHSA-xjhm-gp88-8pfx","PYSEC-2026-1274"],"related":[],"kind":"vulnerability","state":"published","title":"Copier safe template has arbitrary filesystem read access via symlinks when _preserve_symlinks: false","summary":"Copier is a library and CLI app for rendering project templates. Prior to version 9.11.2, 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). Version 9.11.2 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Copier is a library and CLI app for rendering project templates. Prior to version 9.11.2, 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). Version 9.11.2 patches the issue.","source":"cvelist"},{"lang":"en","text":"### 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 include arbitrary files/directories outside the local template clone location by using symlinks along with [`_preserve_symlinks: false`](https://copier.readthedocs.io/en/stable/configuring/#preserve_symlinks) (which is Copier's default setting). \n\nImagine, 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](https://github.com/) where the template author can extract the secrets.\n\nReproducible example:\n\n- Illegally include a file in the generated project via symlink resolution:\n\n    ```shell\n    echo \"s3cr3t\" > secret.txt\n\n    mkdir src/\n    pushd src/\n    ln -s ../secret.txt stolen-secret.txt\n    popd\n\n    uvx copier copy src/ dst/\n\n    cat dst/stolen-secret.txt\n    #s3cr3t\n    ```\n\n- Illegally include a directory in the generated project via symlink resolution:\n\n    ```shell\n    mkdir secrets/\n    pushd secrets/\n    echo \"s3cr3t\" > secret.txt\n    popd\n\n    mkdir src/\n    pushd src/\n    ln -s ../secrets stolen-secrets\n    popd\n\n    uvx copier copy src/ dst/\n\n    tree dst/\n    # dst/\n    # └── stolen-secrets\n    #     └── secret.txt\n    #\n    # 1 directory, 1 file\n    cat dst/stolen-secrets/secret.txt\n    # s3cr3t\n    ```\n\n### Patches\n\nn/a\n\n### Workarounds\n\nn/a\n\n### References\n\nn/a","format":"markdown","source":"ghsa"},{"lang":"es","text":"Copier es una librería y aplicación CLI para renderizar plantillas de proyecto. Antes de la versión 9.11.2, Copier sugiere que es seguro generar un proyecto a partir de una plantilla segura, es decir, una que no utiliza características inseguras como extensiones Jinja personalizadas que requerirían pasar la bandera '--UNSAFE,--trust'. Resulta que una plantilla segura puede actualmente incluir archivos/directorios arbitrarios fuera de la ubicación de clonación de la plantilla local utilizando enlaces simbólicos junto con '_preserve_symlinks: false' (que es la configuración predeterminada de Copier). La versión 9.11.2 corrige el problema.","source":"nvd"}],"published":"2026-01-21T22:08:48.000Z","modified":"2026-07-07T17:57:15.178Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":5.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":5.5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":5.5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"}],"cwes":["CWE-61"],"affected":[{"ranges":[{"version":"< 9.11.2","status":"affected"}],"vendor":"copier-org","product":"copier","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"9.11.2"}],"ecosystem":"PyPI","package":"copier","purl":"pkg:pypi/copier","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"9.11.2"}],"vendor":"copier-org","product":"copier","cpe":"cpe:2.3:a:copier-org:copier:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"9.11.2"}],"ecosystem":"PyPI","package":"copier","purl":"pkg:pypi/copier","source":"pysec"}],"references":[{"url":"https://github.com/copier-org/copier/security/advisories/GHSA-xjhm-gp88-8pfx","tags":["exploit","third-party-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/copier-org/copier/commit/b3a7b3772d17cf0e7a4481978188c9f536c8d8f6","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23968","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/copier-org/copier","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/copier","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-xjhm-gp88-8pfx","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-01-22T15:09:28.359Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-23968","url":"https://www.cve.org/CVERecord?id=CVE-2026-23968","licence":"CVE Terms of Use","modified":"2026-01-22T16:49:32.054Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xjhm-gp88-8pfx","url":"https://github.com/advisories/GHSA-xjhm-gp88-8pfx","licence":"CC-BY-4.0","modified":"2026-07-07T17:57:15.178Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-23968","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23968","licence":"Public domain","modified":"2026-06-17T10:22:22.310Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1274","url":"https://osv.dev/vulnerability/PYSEC-2026-1274","licence":"CC-BY-4.0","modified":"2026-07-07T17:47:20.657Z"}],"updatedAt":"2026-11-25T22:59:13.030Z","epss":{"score":0.00239,"percentile":0.16002,"date":"2026-12-02T12:00:21.000Z"}}