InHand Networks InRouter302 httpd parse_ping_result API buffer overflow vulnerability
The router's httpd API reads a ping result file and parses a line with sscanf into three 32-byte buffers, but the line can be up to 256 bytes, so a crafted file overflows the stack. An attacker who can write that file and call the API could overwrite the saved return address and gain code execution.
Originally disclosed on Cisco Talos
A buffer overflow vulnerability exists in the httpd parsepingresult API functionality of InHand Networks InRouter302 V3.5.4. A specially-crafted file 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
Impact
A crafted file could lead to remote code execution; the text notes this requires the most privileged logged-in user, but chaining with two other issues (TALOS-2022-1472 and TALOS-2022-1468) makes it remotely exploitable by a low-privileged user.
What the attacker needed
Write access to /tmp/ping_result.txt; most privileged logged-in user; request to port 4444
The fix
The vendor released a patch on 2022-05-10.
How it was found
- Place a crafted file at /tmp/ping_result.txt containing a statistics line with an overlong third field.
- Send a request to the apply.cgi API on port 4444 with the parameter parse_ping_result set to PING_Test.
- The server reads the file and parses the overlong line, causing a crash or 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.
A buffer overflow happens when a program copies more data into a fixed-size space than it can hold, so the extra data spills over into nearby memory. Here the router reads a line from a file into small 32-byte boxes, but the line can be much longer, so the extra characters overwrite the place where the program remembers where to return. If an attacker controls that file, they can choose the extra characters and potentially make the router run their code.
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.