Skip to content
RCE Write-up Intermediate

(CVE-20221-35407) Prolink PRC2402M mesh.cgi get_upgrade_page Un-authenticated Command Injection Vulnerability

The mesh.cgi script on the Prolink PRC2402M router passes user input to popen without validation, allowing an unauthenticated attacker to execute arbitrary commands as root. No authentication is required to exploit the vulnerability.

starlabs.sg

Published on starlabs.sg

This vulnerability is present as there are no checks on user input taken by mesh.cgi, which is passed to popen, allowing an attacker to execute arbitrary code in the context of the root user on affected installations of the Prolink PRC2402M router.

The author, on starlabs.sg

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-supplied input to mesh.cgi is passed directly to popen without any validation or sanitisation, enabling command injection.

Impact

An unauthenticated attacker could execute arbitrary code as the root user on affected routers.

What the attacker needed

Network access to the router's web interface

How it was found

  1. Visit the vulnerable script at http://localhost/cgi-bin/mesh.cgi.

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 router runs a small web program that takes input from whoever visits a certain web address. The program does not check what the input is before using it to run system commands, so anyone can make the router run commands of their choosing with the highest privileges. No password is needed.

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.