Fortinet FortiCam FCM-MB40 – Multiple Vulnerabilities
The FortiCam FCM-MB40 camera contains multiple vulnerabilities, including command injection, CSRF, hardcoded SSL keys, cleartext credential storage, and insufficient factory reset. An attacker with admin access could execute commands as root, and a remote attacker could trick an admin into CSRF to achieve the same.
xor.cat
Published on xor.cat
In March of 2019 I discovered five vulnerabilities in Fortinet’s FortiCam FCM-MB40 product.
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 web interface passes user input directly to shell commands without sanitisation, uses GET parameters for state changes without CSRF protection, and stores sensitive data insecurely.
Impact
An attacker with admin access could execute commands as root, and a remote attacker could use CSRF to achieve the same, leading to full control of the device.
What the attacker needed
Admin access to web interface; victim logged in as admin; attacker knows camera IP
The fix
The vulnerabilities should be fixed by sanitising user input, using POST with CSRF tokens, generating unique SSL certificates, hashing credentials, and re-flashing firmware on factory reset.
How it was found
- Set up a netcat listener on the attacker's host.
- Send a crafted request to camctrl_save_profile.cgi with a malicious name parameter.
- Send a request to ddns.cgi to execute the injected command.
- Receive a reverse shell as root.
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.
This report describes several security flaws in a network camera. The most serious lets someone who can log in as admin run commands on the camera with the highest privileges, and another lets a malicious website trick a logged-in admin into making changes. Other issues include shared encryption keys and passwords stored in plain text.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.