/

CVE-2026-112301

Severity:

HIGH RISK

(7.3)

OS Command Injection (CWE-78) in imagemagick-php Font

CVE-2026-112301

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77, CWE-78

Impact:

Remote Code Execution

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A command injection vulnerability in orbitale imagemagick-php affects the font-handling functionality in src/Command.php. When attacker-controlled font file input reaches the vulnerable command construction path, a remote attacker may influence operating-system command execution, depending on how the application exposes this functionality.

A command injection vulnerability in orbitale imagemagick-php affects the font-handling functionality in src/Command.php. When attacker-controlled font file input reaches the vulnerable command construction path, a remote attacker may influence operating-system command execution, depending on how the application exposes this functionality.

Affected context

The issue may affect imagemagick-php deployments using versions up to 3.3.5 when the Command::font function processes font file values from an externally reachable application interface. Risk depends on whether untrusted users can supply or influence the fontFile argument and whether the application invokes ImageMagick operations with the host process's operating-system privileges.

The issue may affect imagemagick-php deployments using versions up to 3.3.5 when the Command::font function processes font file values from an externally reachable application interface. Risk depends on whether untrusted users can supply or influence the fontFile argument and whether the application invokes ImageMagick operations with the host process's operating-system privileges.

Exploit preconditions

  • Attack surface: An application interface or service that exposes font-related imagemagick-php functionality
  • Required access: The ability to submit or influence the fontFile argument, potentially without prior authentication if the surrounding interface permits it
  • Trigger point: Processing the supplied value through Command::font in src/Command.php
  • Why exploitation is possible: The input may be incorporated into an operating-system command without sufficient separation between data and command syntax
  • Attack surface: An application interface or service that exposes font-related imagemagick-php functionality
  • Required access: The ability to submit or influence the fontFile argument, potentially without prior authentication if the surrounding interface permits it
  • Trigger point: Processing the supplied value through Command::font in src/Command.php
  • Why exploitation is possible: The input may be incorporated into an operating-system command without sufficient separation between data and command syntax

Why this happens

The vulnerability is caused by unsafe construction or invocation of an operating-system command using attacker-influenced font file data. If the value is concatenated into a shell command or passed through an interpreter without robust argument separation, command metacharacters may alter the intended operation. This maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with CWE-77: Improper Neutralization of Special Elements in Command describing the broader command-injection class.

The vulnerability is caused by unsafe construction or invocation of an operating-system command using attacker-influenced font file data. If the value is concatenated into a shell command or passed through an interpreter without robust argument separation, command metacharacters may alter the intended operation. This maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with CWE-77: Improper Neutralization of Special Elements in Command describing the broader command-injection class.

Potential impact

  • An attacker may execute arbitrary commands with the privileges of the application process
  • The application host may be compromised
  • Confidential files or environment-held credentials could be accessed
  • Application data may be modified, deleted, or exfiltrated
  • The vulnerable service could be used to access other systems or services
  • An attacker may execute arbitrary commands with the privileges of the application process
  • The application host may be compromised
  • Confidential files or environment-held credentials could be accessed
  • Application data may be modified, deleted, or exfiltrated
  • The vulnerable service could be used to access other systems or services

General mitigation guidance

Mitigation generally focuses on ensuring that font file values remain data rather than command syntax.

Common defensive patterns include:

  • Prefer direct library or process APIs that pass arguments as separate values without invoking a shell
  • Use strict allowlists for permitted font paths, names, and formats
  • Reduce input trust by resolving files from controlled directories rather than accepting arbitrary paths
  • Apply canonicalization and validation before use, while avoiding validation as the sole defense
  • Run image-processing workers with minimal filesystem, network, and operating-system privileges
  • Isolate processing workloads and restrict access to secrets and sensitive host resources

Mitigation generally focuses on ensuring that font file values remain data rather than command syntax.

Common defensive patterns include:

  • Prefer direct library or process APIs that pass arguments as separate values without invoking a shell
  • Use strict allowlists for permitted font paths, names, and formats
  • Reduce input trust by resolving files from controlled directories rather than accepting arbitrary paths
  • Apply canonicalization and validation before use, while avoiding validation as the sole defense
  • Run image-processing workers with minimal filesystem, network, and operating-system privileges
  • Isolate processing workloads and restrict access to secrets and sensitive host resources

How teams detect issues like this

Organizations can look for command-injection risks through:

  • Static analysis rules identifying shell execution, command concatenation, or interpreter invocation near fontFile and similar inputs
  • Code review checks for user-controlled values passed to process-spawning functions
  • Searches for shell metacharacter handling, string-based command assembly, and missing argument arrays
  • Runtime monitoring for unexpected child processes, command interpreters, or unusual ImageMagick process behavior
  • Application logs and policy controls that flag unexpected font paths or image-processing requests

Automated code-review and software-composition tools may help identify related unsafe command-execution patterns.

Organizations can look for command-injection risks through:

  • Static analysis rules identifying shell execution, command concatenation, or interpreter invocation near fontFile and similar inputs
  • Code review checks for user-controlled values passed to process-spawning functions
  • Searches for shell metacharacter handling, string-based command assembly, and missing argument arrays
  • Runtime monitoring for unexpected child processes, command interpreters, or unusual ImageMagick process behavior
  • Application logs and policy controls that flag unexpected font paths or image-processing requests

Automated code-review and software-composition tools may help identify related unsafe command-execution patterns.

Sources

SourceLink
gist.github.comgist.github.com/0xSebin/834b7ab2e72d68be51d204193f427a20
vuldb.comvuldb.com/cve/CVE-2026-112301
vuldb.comvuldb.com/submit/987724
vuldb.comvuldb.com/vuln/422347
vuldb.comvuldb.com/vuln/422347/cti

Frequently asked

questions

It may be remotely exploitable when an externally reachable application exposes the vulnerable font-processing functionality and permits an attacker to influence fontFile.

Not necessarily. Authentication requirements depend on the surrounding application, but the attacker must be able to reach the relevant function and control or influence its input.

Avoid shell-based command construction and pass validated arguments through APIs that preserve argument boundaries. Restrict font selection to controlled paths or allowlisted values.

Combine strict input allowlists, safe process APIs, least-privilege execution, code review for command construction, and runtime monitoring for unexpected child processes.

It may be remotely exploitable when an externally reachable application exposes the vulnerable font-processing functionality and permits an attacker to influence fontFile.

Not necessarily. Authentication requirements depend on the surrounding application, but the attacker must be able to reach the relevant function and control or influence its input.

Avoid shell-based command construction and pass validated arguments through APIs that preserve argument boundaries. Restrict font selection to controlled paths or allowlisted values.

Combine strict input allowlists, safe process APIs, least-privilege execution, code review for command construction, and runtime monitoring for unexpected child processes.

Find out what's already
exploitable in your codebase.