CVE-2025-65791

9.8 CRITICAL

📋 TL;DR

CVE-2025-65791 is a critical command injection vulnerability in ZoneMinder's image.php component that allows attackers to execute arbitrary commands on the server. This affects all ZoneMinder installations running vulnerable versions, potentially compromising the entire system. Attackers can exploit this remotely without authentication.

💻 Affected Systems

Products:
  • ZoneMinder
Versions: v1.36.34 and potentially earlier versions
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: All default installations with the vulnerable version are affected. The vulnerability is in the web interface component.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise leading to data theft, ransomware deployment, lateral movement to other systems, and persistent backdoor installation.

🟠

Likely Case

Remote code execution leading to web server compromise, surveillance system disruption, and credential harvesting from the ZoneMinder environment.

🟢

If Mitigated

Limited impact if proper network segmentation, web application firewalls, and input validation are implemented, though risk remains elevated.

🌐 Internet-Facing: HIGH - The vulnerability is in a web-accessible component and requires no authentication, making internet-facing instances extremely vulnerable.
🏢 Internal Only: HIGH - Even internally accessible instances are vulnerable to internal attackers or compromised accounts.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

The GitHub reference contains proof-of-concept code demonstrating exploitation. The vulnerability requires minimal technical skill to exploit.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check ZoneMinder GitHub releases for patched version > v1.36.34

Vendor Advisory: https://github.com/ZoneMinder/zoneminder/security/advisories

Restart Required: Yes

Instructions:

1. Backup ZoneMinder configuration and database. 2. Update ZoneMinder to the latest patched version via package manager or source. 3. Restart ZoneMinder service and web server. 4. Verify the fix by testing the vulnerable endpoint.

🔧 Temporary Workarounds

Input Validation Filter

linux

Add input validation to sanitize user input before passing to exec() function

Modify web/views/image.php to validate and sanitize all user inputs using escapeshellarg() or similar functions

Web Application Firewall

all

Deploy WAF rules to block command injection patterns

Add WAF rules to detect and block patterns like ;, |, &, $, (, ) in image.php parameters

🧯 If You Can't Patch

  • Restrict network access to ZoneMinder web interface using firewall rules to only trusted IP addresses
  • Run ZoneMinder in a containerized environment with minimal privileges and network isolation

🔍 How to Verify

Check if Vulnerable:

Check if ZoneMinder version is v1.36.34 or earlier and examine web/views/image.php for unsanitized exec() calls

Check Version:

zmdc.pl version or check /usr/share/zoneminder/www/includes/version.php

Verify Fix Applied:

Test the vulnerable endpoint with command injection payloads and verify they are blocked or sanitized

📡 Detection & Monitoring

Log Indicators:

  • Unusual exec() commands in web server logs
  • Suspicious parameters in image.php requests
  • Unexpected system commands from web user

Network Indicators:

  • HTTP requests to image.php with command injection patterns
  • Outbound connections from ZoneMinder server to unexpected destinations

SIEM Query:

source="web_server_logs" AND uri="*image.php*" AND (param="*;*" OR param="*|*" OR param="*&*" OR param="*$(*")

🔗 References

📤 Share & Export