Security Advisory: Remote Code Execution on Diviotec IP Camera (CVE-2025-5113) | ONEKEY Research
A CGI script on Diviotec IP cameras passes unsanitised user input from the query string into a sed command, allowing command injection. An attacker with default credentials can execute commands as the apache user, which can escalate to root without a password.
onekey.com
Published on onekey.com
Example H2
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, user input from the QUERY_STRING environment variable is passed to a sed command without sanitisation, enabling command injection.
Impact
A remote attacker with default credentials could execute arbitrary commands with apache privileges and escalate to root, gaining full control of the device.
What the attacker needed
Network access to the camera's web interface; default or weak credentials
The fix
The text does not state a fix; it recommends isolating cameras, replacing default passwords, requesting a firmware update, re-auditing CGI scripts for input sanitisation, and removing unnecessary sudo privileges for the apache user.
How it was found
- Send a crafted POST request to the camctrl.cgi endpoint with a malicious digitalzoom_num parameter.
- Authenticate using default credentials found in users.db or appweb.userpass.
- The injected command executes with apache user privileges.
- Escalate to root because the apache user can run any command via sudo without a password.
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.
The camera's web interface runs small shell scripts. One script takes text from the web address and puts it directly into a system command without cleaning it, so an attacker can add their own commands. The attacker also needs a password, but the devices ship with default passwords that are easy to find.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.