Skip to content
RCE Advisory Advanced CVE-2022-26085

InHand Networks InRouter302 httpd wlscan_ASP OS command injection vulnerability

The router's web server builds a shell command from a stored interface name without sanitising it, so a logged-in user who can set that value can run arbitrary commands on the device. The text states that controlling the interface name and a related flag leads to command injection.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

Critical 9.9 View original

An OS command injection vulnerability exists in the httpd wlscanASP functionality of InHand Networks InRouter302 V3.5.4. A specially-crafted HTTP request can lead to arbitrary command 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

Likely the interface name read from nvram is copied into a fixed buffer and then formatted into a shell command passed to popen without any sanitisation.

Impact

An authenticated attacker could execute arbitrary commands on the router, and the vendor released a patch.

What the attacker needed

Authenticated access to the router; ability to set wl0_ap and wl0_iface

The fix

The vendor released updated firmware that addresses the issue.

How it was found

  1. Set the wl0_ap value to zero so the vulnerable branch is taken.
  2. Set the wl0_iface value to include extra shell commands.
  3. Request an HTML page containing the wlscan template token while logged in.
  4. The server runs the crafted command through popen.

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 keeps some settings in a small storage area and later pastes one of them into a command it runs on the underlying operating system. Because the setting is not cleaned, someone who can change it can add extra commands that the router will run with its own privileges. This is called command injection.

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.