Skip to content
RCE Advisory Intermediate CVE-2022-26420

InHand Networks InRouter302 console infactory_port OS command injection vulnerability

An OS command injection vulnerability exists in the console infactory_port functionality of InHand Networks InRouter302 V3.5.37. An attacker with valid credentials can send a crafted command to obtain a root shell.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

Critical 9.9 View original

An OS command injection vulnerability exists in the console infactoryport functionality of InHand Networks InRouter302 V3.5.37. A specially-crafted series of network requests can lead to remote code execution.

Francesco Benvenuto, on Cisco Talos

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 report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The second argument to the 'port' command is not sanitised before being used in a system() call.

What the attacker needed

Valid credentials for console access; factory mode password

The fix

The vendor released a patch; the input should be properly sanitised before being passed to system().

How it was found

  1. Log in to the router console via telnet or SSH with valid credentials.
  2. Enter the 'infactory' command and provide the correct password to enter factory mode.
  3. Run the 'port' command with 'up' as the first argument and a crafted interface name containing shell metacharacters as the second argument.

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 report has not been written yet. The Original tab links to the source.

The router's console has a factory mode where you can run commands. One command, 'port', takes an interface name and passes it to a system command without cleaning it. By putting special characters in the interface name, an attacker can run their own commands and get full control of the router.

What is RCE?

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

More by Francesco Benvenuto

View all

152 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

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.