Summary
ZoneMinder contains an authenticated operating system command injection vulnerability in its event export functionality. An authenticated user with View Events permission may be able to execute arbitrary operating system commands when an export request parameter is incorporated into a shell command without adequate sanitization.
Affected context
The vulnerability occurs in ZoneMinder deployments where the event export endpoint processes the exportFile HTTP request parameter and passes it to a shell command through PHP's exec() function. Risk depends on the endpoint being reachable by an authenticated account with View Events permission and on the application service having sufficient operating system privileges.
Exploit preconditions
- Attack surface: Authenticated HTTP event export functionality
- Required access: A valid account with View Events permission
- Trigger point: Processing of the
exportFilerequest parameter - Why exploitation is possible: User-controlled input reaches a shell command without adequate command-boundary enforcement or neutralization
Why this happens
The underlying bug is an OS command injection flaw mapped to CWE-78. The application constructs or invokes a shell command using a request parameter that remains under user influence, allowing shell interpretation to alter the command's intended behavior. Reliance on shell execution for a value that should be treated as data creates an unsafe boundary between web input and operating system operations.
Potential impact
- An attacker may execute arbitrary commands under the application service account.
- The attacker could access, alter, or delete files available to that account.
- The vulnerability may enable modification of exported event data or other application data.
- A compromised service account could support lateral movement or further host compromise.
General mitigation guidance
Mitigation generally focuses on removing shell interpretation from event
export operations and reducing the trust placed in request parameters.
Common defensive patterns include:
- Prefer direct process or library APIs that do not invoke a shell.
- Treat export paths and filenames as data, using strict allowlists and canonicalization.
- Apply server-side validation tied to the expected export format and destination.
- Avoid accepting caller-controlled command fragments or executable options.
- Run the application with a dedicated least-privilege service account.
- Restrict filesystem, process, and network permissions available to the service.
- Enforce authorization checks consistently at the export endpoint and related handlers.
How teams detect issues like this
Organizations can look for command injection risks through:
- Static analysis rules identifying
exec(), shell invocation, and string concatenation with request parameters. - Code review checks for HTTP input flowing into process execution or file-export commands.
- Tests that verify export parameters are handled through direct APIs rather than shell parsing.
- Web application monitoring for unusual event export requests, command metacharacters, or unexpected file paths.
- Runtime policy enforcement that restricts child-process creation and service-account privileges.
Automated application-security review tools may help identify request-to-command execution paths during development.

