Security Vulnerability Report
中文
CVE-2026-34726 CVSS 4.4 MEDIUM

CVE-2026-34726

Published: 2026-04-02 19:21:32
Last Modified: 2026-04-03 19:40:49

Description

Copier is a library and CLI app for rendering project templates. Prior to version 9.14.1, Copier's _subdirectory setting is documented as the subdirectory to use as the template root. However, the current implementation accepts parent-directory traversal such as .. and uses it directly when selecting the template root. As a result, a template can escape its own directory and make Copier render files from the parent directory without --UNSAFE. This issue has been patched in version 9.14.1.

CVSS Details

CVSS Score
4.4
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:copier-org:copier:*:*:*:*:*:python:*:* - VULNERABLE
Copier < 9.14.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# Malicious copier.yml configuration # This configuration exploits the _subdirectory traversal _subdirectory: "../../sensitive_data" # When a victim runs: # copier copy path/to/malicious/template ./target # # Copier will interpret the template root as the parent's parent directory, # potentially reading or rendering files outside the intended template scope.

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-34726", "sourceIdentifier": "[email protected]", "published": "2026-04-02T19:21:32.320", "lastModified": "2026-04-03T19:40:49.070", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Copier is a library and CLI app for rendering project templates. Prior to version 9.14.1, Copier's _subdirectory setting is documented as the subdirectory to use as the template root. However, the current implementation accepts parent-directory traversal such as .. and uses it directly when selecting the template root. As a result, a template can escape its own directory and make Copier render files from the parent directory without --UNSAFE. This issue has been patched in version 9.14.1."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N", "baseScore": 4.4, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.8, "impactScore": 2.5}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-22"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:copier-org:copier:*:*:*:*:*:python:*:*", "versionEndExcluding": "9.14.1", "matchCriteriaId": "08914294-5C57-49CB-8D05-BBB156C6B8B1"}]}]}], "references": [{"url": "https://github.com/copier-org/copier/commit/cb80a3ffc9c3787de3ed837e04ca29a0ff8ca3df", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/copier-org/copier/releases/tag/v9.14.1", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/copier-org/copier/security/advisories/GHSA-85v3-4m8g-hrh6", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/copier-org/copier/security/advisories/GHSA-85v3-4m8g-hrh6", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Vendor Advisory"]}]}}