Summary
ZoneMinder's configuration-editing API does not adequately enforce authorization for protected settings, allowing any authenticated user to change them. If a modified setting reaches a command-execution path, an attacker may execute commands with the web server user's privileges.
Affected context
The issue affects ZoneMinder deployments with the vulnerable configuration-editing behavior. The /api/configs/edit/{name}.json endpoint permits changes to protected settings without the required system-edit authorization, and protection for system variables is ineffective. The described command-execution path involves the ZM_PATH_FFMPEG setting and frame extraction in web/views/image.php or web/includes/Event.php.
Exploit preconditions
- Attack surface: The ZoneMinder configuration-editing API and frame-extraction functionality
- Required access: An authenticated ZoneMinder account; the described issue does not require the System=Edit authorization
- Trigger point: A request that causes frame extraction to use the modified
ZM_PATH_FFMPEGsetting - Why exploitation is possible: The endpoint allows changes to protected configuration values, which can reach an
exec()sink
Why this happens
The controller does not enforce the required authorization check for editing system configuration, and its protection for system variables is ineffective. This is a missing authorization flaw mapped to CWE-862: access to a sensitive operation is not properly checked before it is performed. When a protected value influences a command-execution sink, the authorization failure can enable command execution.
Potential impact
- An attacker may execute commands with the privileges of the web server user
- Private camera feeds or recordings could be exposed
- Database data may be accessed or compromised
- An attacker could establish persistence in the affected environment
General mitigation guidance
Defensive approaches focus on enforcing authorization at the server-side operation and protecting sensitive configuration values.
- Require explicit, role-appropriate authorization for every configuration-edit operation
- Enforce protected-setting restrictions consistently in the controller and underlying service
- Avoid passing configuration values to shell command execution; use safer APIs and constrained arguments where command invocation is necessary
- Treat editable configuration as untrusted input and apply strict validation
- Run the web server with least privilege and limit access to sensitive camera and database data
How teams detect issues like this
- Review API controllers and service methods for configuration changes that lack server-side authorization checks
- Use static analysis to identify configuration values flowing into
exec()or other command-execution functions - Audit role and access-control policies to ensure protected settings require the intended permission
- Monitor configuration changes and unusual frame-extraction activity, with alerts for changes to command-related settings

