Yifan YF325 httpd next_page buffer overflow vulnerability
The router's web server copies a user-supplied 'next_page' parameter into a fixed-size stack buffer without checking its length. An unauthenticated attacker could send an oversized value and potentially execute commands on the device.
Originally disclosed on Cisco Talos
A buffer overflow vulnerability exists in the httpd nextpage functionality of Yifan YF325 v1.020221108. A specially crafted network request can lead to command 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 code copies the attacker-controlled 'next_page' request parameter into a fixed-size stack buffer using strcpy with no length check.
Impact
An unauthenticated attacker could send a crafted network request that overflows the stack buffer and may lead to command execution on the device.
What the attacker needed
Network access to the router's web server; no authentication needed
The fix
The copy should be bounded to the size of the destination buffer, for example by using a length-limited copy instead of strcpy; the text notes a vendor patch was released but does not describe it.
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 memory space than it can hold, so the extra data spills over into neighbouring memory. Here the router's web server takes a value from the request and copies it without checking the length, so a very long value can overwrite memory the program relies on. An attacker who can control that spilled data may be able to make the device run their own commands.
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.