/

CVE-2026-30971

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in ZoneMinder Control

CVE-2026-30971

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary command execution

Severity:

HIGH RISK

(8.8)

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

ZoneMinder contains an operating system command injection flaw in monitor control and startup paths that incorporate an unvalidated monitor Device field into shell commands. An authenticated user with monitor-create or monitor-edit permission may be able to execute arbitrary commands as the web server user when a Local monitor configuration is saved and subsequently processed.

ZoneMinder contains an operating system command injection flaw in monitor control and startup paths that incorporate an unvalidated monitor Device field into shell commands. An authenticated user with monitor-create or monitor-edit permission may be able to execute arbitrary commands as the web server user when a Local monitor configuration is saved and subsequently processed.

Affected context

The vulnerability affects ZoneMinder deployments where an authenticated account can create or edit Local monitors and influence the Device Path value. Risk arises when the stored value is later processed by PHP or Perl control and startup code that invokes shell commands, including paths where validation or argument handling occurs after command execution has already been reached.

The vulnerability affects ZoneMinder deployments where an authenticated account can create or edit Local monitors and influence the Device Path value. Risk arises when the stored value is later processed by PHP or Perl control and startup code that invokes shell commands, including paths where validation or argument handling occurs after command execution has already been reached.

Exploit preconditions

  • Attack surface: ZoneMinder web application monitor-management and control paths
  • Required access: An authenticated account with monitor-create or monitor-edit permission
  • Trigger point: Saving and subsequently processing a Local monitor whose Device Path is treated as command input
  • Why exploitation is possible: Unvalidated stored data reaches shell execution mechanisms, while some escaping and detainting controls do not reliably prevent command interpretation
  • Attack surface: ZoneMinder web application monitor-management and control paths
  • Required access: An authenticated account with monitor-create or monitor-edit permission
  • Trigger point: Saving and subsequently processing a Local monitor whose Device Path is treated as command input
  • Why exploitation is possible: Unvalidated stored data reaches shell execution mechanisms, while some escaping and detainting controls do not reliably prevent command interpretation

Why this happens

The underlying flaw is the construction of shell commands from a monitor Device value that has not been treated as strictly trusted data. PHP command paths rely on incomplete or bypassable shell escaping, while Perl execution paths can process the stored value through shell-backed execution before effective argument detainting. This behavior maps to CWE-78, where externally influenced input is incorporated into operating system command execution without robust separation between data and commands.

The underlying flaw is the construction of shell commands from a monitor Device value that has not been treated as strictly trusted data. PHP command paths rely on incomplete or bypassable shell escaping, while Perl execution paths can process the stored value through shell-backed execution before effective argument detainting. This behavior maps to CWE-78, where externally influenced input is incorporated into operating system command execution without robust separation between data and commands.

Potential impact

  • An attacker may execute arbitrary commands as the web server user
  • The application runtime could be compromised
  • Sensitive camera, system, or configuration data could be accessed
  • Attackers could alter surveillance behavior or stored monitoring data
  • The host could be used for privilege escalation or lateral movement
  • An attacker may execute arbitrary commands as the web server user
  • The application runtime could be compromised
  • Sensitive camera, system, or configuration data could be accessed
  • Attackers could alter surveillance behavior or stored monitoring data
  • The host could be used for privilege escalation or lateral movement

General mitigation guidance

Mitigation generally centers on eliminating shell interpretation of

user-controlled monitor fields and reducing the trust placed in stored

configuration data.

Common defensive patterns include:

  • Prefer direct process APIs with argument arrays over shell command construction
  • Apply strict allowlists and canonical validation to Device Path values
  • Treat previously stored configuration as untrusted at every execution boundary
  • Ensure validation occurs before any command or subprocess is invoked
  • Avoid relying on escaping alone as a security boundary
  • Run the web server and related workers with least privilege and restricted filesystem access
  • Separate monitor-management permissions from operational command privileges where practical
  • Use secure-by-default configurations that disable unnecessary control and startup actions

Mitigation generally centers on eliminating shell interpretation of

user-controlled monitor fields and reducing the trust placed in stored

configuration data.

Common defensive patterns include:

  • Prefer direct process APIs with argument arrays over shell command construction
  • Apply strict allowlists and canonical validation to Device Path values
  • Treat previously stored configuration as untrusted at every execution boundary
  • Ensure validation occurs before any command or subprocess is invoked
  • Avoid relying on escaping alone as a security boundary
  • Run the web server and related workers with least privilege and restricted filesystem access
  • Separate monitor-management permissions from operational command privileges where practical
  • Use secure-by-default configurations that disable unnecessary control and startup actions

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules identifying concatenation or interpolation of request and database values into shell execution APIs
  • Code review checks for PHP shell functions, Perl backticks, qx(), and similar subprocess interfaces
  • Tests using metacharacter-bearing input to verify that values remain data rather than commands
  • Review of monitor Device Path validation, canonicalization, and allowlist enforcement
  • Runtime monitoring for unexpected child processes launched by the web server or ZoneMinder workers
  • Policy enforcement that requires direct argument-based process execution and prohibits shell invocation for untrusted values

Automated code review and application security testing tools may help identify these patterns.

Organizations can look for this weakness through:

  • Static analysis rules identifying concatenation or interpolation of request and database values into shell execution APIs
  • Code review checks for PHP shell functions, Perl backticks, qx(), and similar subprocess interfaces
  • Tests using metacharacter-bearing input to verify that values remain data rather than commands
  • Review of monitor Device Path validation, canonicalization, and allowlist enforcement
  • Runtime monitoring for unexpected child processes launched by the web server or ZoneMinder workers
  • Policy enforcement that requires direct argument-based process execution and prohibits shell invocation for untrusted values

Automated code review and application security testing tools may help identify these patterns.

Sources

SourceLink
github.comgithub.com/ZoneMinder/zoneminder/commit/419846c8750c3f45b9b8a1df8cd49c189a14dc03
github.comgithub.com/ZoneMinder/zoneminder/security/advisories/GHSA-g66m-77fq-79v9

Frequently asked

questions

It can be exploitable through the ZoneMinder web application when an

authenticated user has the required monitor-create or monitor-edit

permission and the affected monitor processing path runs.

The attacker generally needs authenticated access with permission to save or

modify Local monitor configuration, including the Device Path field.

Remove shell interpretation from monitor-processing paths, use direct

argument-based process execution, and enforce strict validation before any

subprocess is started.

Treat stored configuration as untrusted input, prohibit command

construction from user-controlled values, apply least privilege, and use

static analysis and runtime monitoring to detect unsafe process execution.

It can be exploitable through the ZoneMinder web application when an

authenticated user has the required monitor-create or monitor-edit

permission and the affected monitor processing path runs.

The attacker generally needs authenticated access with permission to save or

modify Local monitor configuration, including the Device Path field.

Remove shell interpretation from monitor-processing paths, use direct

argument-based process execution, and enforce strict validation before any

subprocess is started.

Treat stored configuration as untrusted input, prohibit command

construction from user-controlled values, apply least privilege, and use

static analysis and runtime monitoring to detect unsafe process execution.

Find out what's already
exploitable in your codebase.