Skip to content
RCE Write-up Intermediate

RCE (Remote Code Execution)in Zoneminder up to 1.36.33

ZoneMinder up to 1.36.33 allows an authenticated user to set the debug log file path to a .php file inside the language folder, then inject PHP code via the Home View field and select that log file as the user's language, leading to remote code execution when the user logs in.

medium.com

Published on medium.com

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras. It’s a very powerful tool and it’s one of the most used, probably the most used video surveillance tool on linux.

dk50u1, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application allows unrestricted control over the debug log file path and does not validate that language files are legitimate, so a user-controlled log file containing PHP code can be loaded and executed as a language file.

Impact

An authenticated user with access to logging and user settings could execute arbitrary commands on the server, leading to full compromise.

What the attacker needed

Authenticated user with access to logging and user settings; ability to intercept and modify HTTP requests

How it was found

  1. In Options -> Logging, set LOG_DEBUG_FILE to /usr/share/zoneminder/www/lang/rce.php and enable LOG_DEBUG to create the log file.
  2. In Options -> Users, set a user's Home View to a PHP payload that executes a command.
  3. Intercept the save request and change the user's language to rce (without .php) so the log file is used as the language file.
  4. Log in as that user; the application loads rce.php as the language and executes the injected PHP payload.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

ZoneMinder lets an admin choose where to write debug logs and what language a user sees. The report shows that these two settings can be abused: you can make the log file a PHP script inside the language folder, put PHP code into a user's home view, and then set that user's language to the log file. When the user logs in, the PHP code runs on the server, giving command execution.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.