CVE-2023-25825

7.7 HIGH

📋 TL;DR

ZoneMinder versions before 1.36.33 are vulnerable to stored cross-site scripting (XSS) through malicious referrer field injection in database logs. When administrators view logs in the web interface, the unescaped malicious content executes in their browser context. This affects all ZoneMinder installations with web UI access.

💻 Affected Systems

Products:
  • ZoneMinder
Versions: All versions prior to 1.36.33
Operating Systems: Linux
Default Config Vulnerable: ⚠️ Yes
Notes: All ZoneMinder installations with web UI enabled are affected. The vulnerability requires access to inject malicious referrer data into logs.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An attacker could inject malicious JavaScript that executes with administrator privileges when logs are viewed, potentially leading to session hijacking, credential theft, or complete system compromise.

🟠

Likely Case

Attackers inject malicious scripts that execute when administrators review logs, potentially stealing session cookies or performing actions as the administrator.

🟢

If Mitigated

With proper input validation and output encoding, the malicious referrer data would be treated as text rather than executable code, preventing XSS.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires ability to inject malicious referrer data into logs, which typically requires some level of access or ability to manipulate HTTP requests.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.36.33

Vendor Advisory: https://github.com/ZoneMinder/zoneminder/security/advisories/GHSA-68vf-g4qm-jr6v

Restart Required: Yes

Instructions:

1. Backup your ZoneMinder configuration and database. 2. Update ZoneMinder to version 1.36.33 or later using your package manager or from source. 3. Restart the ZoneMinder service and web server. 4. Verify the update was successful.

🔧 Temporary Workarounds

Disable Web UI Log Viewing

linux

Prevent access to the log viewing functionality in the web interface

# Modify ZoneMinder web configuration to restrict log access
# Or use web server access controls to block /zm/index.php?view=log

Implement WAF Rules

linux

Add web application firewall rules to block malicious referrer headers

# Example mod_security rule for Apache:
SecRule REQUEST_HEADERS:Referer "@rx <script" "id:1001,phase:1,deny,status:403"

🧯 If You Can't Patch

  • Implement strict input validation for referrer headers at the web server level
  • Disable or restrict access to the log viewing interface for all users

🔍 How to Verify

Check if Vulnerable:

Check ZoneMinder version via web interface or command line. Versions below 1.36.33 are vulnerable.

Check Version:

zmupdate.pl -v 2>/dev/null | grep Version || grep ZM_VERSION /usr/share/zoneminder/db/zmupdate.sql

Verify Fix Applied:

After updating, verify version is 1.36.33 or higher and test that referrer data in logs is properly escaped when viewed.

📡 Detection & Monitoring

Log Indicators:

  • Unusual referrer headers containing script tags or JavaScript in ZoneMinder logs
  • Multiple failed attempts with crafted referrer values

Network Indicators:

  • HTTP requests with suspicious referrer headers containing script tags or encoded JavaScript

SIEM Query:

source="zoneminder" AND (referrer="*<script*" OR referrer="*javascript:*")

🔗 References

📤 Share & Export