Security Vulnerability Report
中文
CVE-2026-42311 CVSS 7.8 HIGH

CVE-2026-42311

Published: 2026-05-09 06:16:10
Last Modified: 2026-05-14 20:27:46

Description

Pillow is a Python imaging library. From version 10.3.0 to before version 12.2.0, processing a malicious PSD file could lead to memory corruption, potentially resulting in a crash or arbitrary code execution. This issue has been patched in version 12.2.0.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:* - VULNERABLE
Pillow >= 10.3.0, < 12.2.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import sys from PIL import Image # Proof of Concept for CVE-2026-42311 # This script demonstrates the trigger condition by attempting to open # a crafted malicious PSD file. def trigger_vulnerability(file_path): try: print(f"[*] Attempting to open {file_path}...") # The vulnerability is triggered during the parsing of the PSD file img = Image.open(file_path) # Force the image data to be loaded to trigger the parsing logic img.load() print("[+] File processed successfully (Vulnerability likely not triggered or patched).") except Exception as e: print(f"[-] An exception occurred: {e}") # Depending on the specific corruption, this might be a crash or a controlled error if __name__ == "__main__": # In a real scenario, 'malicious.psd' would contain the specific bytes # causing the memory corruption. malicious_file = "malicious.psd" # Create a dummy file for demonstration purposes if it doesn't exist # (Actual exploit requires specific binary structure) try: with open(malicious_file, "rb") as f: pass except FileNotFoundError: print("[!] Please provide a valid malicious PSD file named 'malicious.psd' to test.") sys.exit(1) trigger_vulnerability(malicious_file)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42311", "sourceIdentifier": "[email protected]", "published": "2026-05-09T06:16:10.430", "lastModified": "2026-05-14T20:27:45.590", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Pillow is a Python imaging library. From version 10.3.0 to before version 12.2.0, processing a malicious PSD file could lead to memory corruption, potentially resulting in a crash or arbitrary code execution. This issue has been patched in version 12.2.0."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/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": 8.6, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "HIGH", "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:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-190"}, {"lang": "en", "value": "CWE-787"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*", "versionStartIncluding": "10.3.0", "versionEndExcluding": "12.2.0", "matchCriteriaId": "F722B42F-A7FE-443E-87A2-4BCD3EFE3180"}]}]}], "references": [{"url": "https://github.com/python-pillow/Pillow/commit/58f9a1d166dcb0c274807d4423522d205b0c35ea", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/python-pillow/Pillow/pull/9520", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/python-pillow/Pillow/releases/tag/12.2.0", "source": "[email protected]", "tags": ["Product", "Release Notes"]}, {"url": "https://github.com/python-pillow/Pillow/security/advisories/GHSA-pwv6-vv43-88gr", "source": "[email protected]", "tags": ["Patch", "Vendor Advisory"]}]}}