InHand Networks InRouter302 console factory stack-based buffer overflow vulnerability
A stack-based buffer overflow exists in the hidden 'factory' command of the InRouter302 console, where a crafted argument can overflow a buffer and overwrite saved registers, potentially leading to remote code execution. An attacker with privileged credentials can send a malicious command to trigger the overflow.
Originally disclosed on Cisco Talos
A stack-based buffer overflow vulnerability exists in the console factory functionality of InHand Networks InRouter302 V3.5.4. A specially-crafted network request can lead to remote code execution.
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 'factory' command uses sprintf to copy a user-supplied token into a fixed-size stack buffer without checking length, allowing a buffer overflow.
Impact
An attacker with privileged credentials could achieve remote code execution; with a chained vulnerability (TALOS-2022-1472), a low-privileged user could also trigger it.
What the attacker needed
Valid privileged credentials; network access to console (telnet/ssh)
The fix
The vendor has released a firmware update to address the vulnerability.
How it was found
- Log in to the router console with privileged credentials.
- Enter privileged mode using the 'enable' command and provide the password.
- Run the hidden 'factory' command with an argument starting with 'iwpriv' followed by a long second token.
- The long token overflows the stack buffer and overwrites saved registers, potentially leading to code execution.
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.
This report describes a memory corruption bug in an industrial router's command-line interface. When a user runs a hidden 'factory' command with a long argument, the program writes more data into a fixed-size memory buffer than it can hold, overwriting nearby data that controls program flow. This could let an attacker run their own code on the device.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.