CVE-2026-25797
JSON

5.7medium

ImageMagick vulnerable to Code injection via PostScript header in ps coders

Severity
5.7medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.21% (higher than 7% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-rw6c-xp26-225v

Description

ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to versions 7.1.2-15 and 6.9.13-40, the ps coders, responsible for writing PostScript files, fails to sanitize the input before writing it into the PostScript header. An attacker can provide a malicous file and inject arbitrary PostScript code. When the resulting file is processed by a printer or a viewer (like Ghostscript), the injected code is interpreted and executed. The html encoder does not properly escape strings that are written to in the html document. An attacker can provide a malicious file and injection arbitrary html code. Versions 7.1.2-15 and 6.9.13-40 contain a patch.

Affected

Product or packageVersionsReported by
ImageMagick ImageMagick>= 7.0.0, < 7.1.2-15, < 6.9.13-40, before 6.9.13-40, from 7.0.0-0 before 7.1.2-15CVE List, NVD
Magick.NET-Q16-AnyCPU (NuGet)before 14.10.3GitHub Advisory Database
Magick.NET-Q16-HDRI-AnyCPU (NuGet)before 14.10.3GitHub Advisory Database
Magick.NET-Q16-HDRI-OpenMP-arm64 (NuGet)before 14.10.3GitHub Advisory Database
Magick.NET-Q16-HDRI-OpenMP-x64 (NuGet)before 14.10.3GitHub Advisory Database
Magick.NET-Q16-HDRI-arm64 (NuGet)before 14.10.3GitHub Advisory Database
Magick.NET-Q16-HDRI-x64 (NuGet)before 14.10.3GitHub Advisory Database
Magick.NET-Q16-HDRI-x86 (NuGet)before 14.10.3GitHub Advisory Database
Magick.NET-Q16-OpenMP-x64 (NuGet)before 14.10.3GitHub Advisory Database
Magick.NET-Q16-OpenMP-x86 (NuGet)before 14.10.3GitHub Advisory Database
Magick.NET-Q16-arm64 (NuGet)before 14.10.3GitHub Advisory Database
Magick.NET-Q16-x86 (NuGet)before 14.10.3GitHub Advisory Database

All scores

GitHub_M5.7medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:L
GitHub5.7medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:L
NVD5.3medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L

Classification

CWE-94

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

ImageMagick is free and open-source software used for editing and manipulating digital images. Prior to versions 7.1.2-15 and 6.9.13-40, the ps coders, responsible for writing PostScript files, fails to sanitize the input before writing it into the PostScript header. An attacker can provide a malicous file and inject arbitrary PostScript code. When the resulting file is processed by a printer or a viewer (like Ghostscript), the injected code is interpreted and executed. The html encoder does not properly escape strings that are written to in the html document. An attacker can provide a malicious file and injection arbitrary html code. Versions 7.1.2-15 and 6.9.13-40 contain a patch.

GitHub Advisory Database

The ps encoders, responsible for writing PostScript files, fails to sanitize the input before writing it into the PostScript header. An attacker can provide a malicious file and inject arbitrary PostScript code. When the resulting file is processed by a printer or a viewer (like Ghostscript), the injected code is interpreted and executed.

The html encoder does not properly escape strings that are written to in the html document. An attacker can provide a malicious file and injection arbitrary html code.

NVD (es)

ImageMagick es un software libre y de código abierto utilizado para editar y manipular imágenes digitales. Antes de las versiones 7.1.2-15 y 6.9.13-40, los codificadores ps, responsables de escribir archivos PostScript, no sanean la entrada antes de escribirla en la cabecera PostScript. Un atacante puede proporcionar un archivo malicioso e inyectar código PostScript arbitrario. Cuando el archivo resultante es procesado por una impresora o un visor (como Ghostscript), el código inyectado es interpretado y ejecutado. El codificador html no escapa correctamente las cadenas que se escriben en el documento html. Un atacante puede proporcionar un archivo malicioso e inyectar código html arbitrario. Las versiones 7.1.2-15 y 6.9.13-40 contienen un parche.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-25797 changed 2026-02-26CVE Terms of Use
GitHub Advisory DatabaseGHSA-rw6c-xp26-225v changed 2026-02-24CC-BY-4.0
NVDCVE-2026-25797 changed 2026-06-17Public domain