Cisco RV34X Series – Authentication Bypass and Remote Command Execution
The web management interface of Cisco RV34X routers had an authentication bypass in the /upload endpoint because any non-null Authorization header was accepted, and a command injection in the sessionid cookie value that was passed unsanitised to a shell command. An unauthenticated attacker could chain these to execute arbitrary commands on the device.
iot-inspector.com
Published on iot-inspector.com
In early 2021, we reported a few security issues to Cisco related to their RV34X series of routers, two of which have been recently patched. The issues in question were an authentication bypass and system command injection, both in the web management interface.
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 nginx configuration used a logic error where any non-empty Authorization header set the deny flag to 0, and the upload.cgi binary passed the sessionid cookie value directly into a sprintf call that built a shell command.
Impact
An unauthenticated attacker could execute arbitrary commands on the router with the privileges of the www-data user, potentially leading to full compromise.
What the attacker needed
Network access to the router's web interface
The fix
The issues were fixed in firmware version 1.0.03.21 for RV34X and [redacted] for RV16X/RV26X.
How it was found
- Send a request to the /upload endpoint with any non-null Authorization header to bypass authentication.
- Include a crafted sessionid cookie value containing shell metacharacters.
- The upload.cgi binary reads the cookie and passes the sessionid value into a curl command via sprintf and popen, executing the injected commands.
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 two flaws in a router's web admin page. The first flaw lets anyone skip the login check by sending a fake 'Authorization' header, because the code only checks that the header exists, not that it is valid. The second flaw lets an attacker run system commands on the router by putting special characters in a cookie value that is later used to build a command. Together, an attacker on the network could take control of the router without logging in.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.