Yifan YF325 httpd manage_request stack-based buffer overflow vulnerability
The router's request-parsing function copies a URL path beginning with tmp/sd into a fixed-size stack buffer without checking its length. An unauthenticated attacker could send a crafted network request to overflow that buffer, potentially leading to code execution.
Originally disclosed on Cisco Talos
A stack-based buffer overflow vulnerability exists in the httpd managerequest functionality of Yifan YF325 v1.020221108. A specially crafted network request can lead to stack-based buffer overflow.
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 uses sprintf to prepend a slash to the URL path and store it in a fixed 0x80-byte stack buffer without validating the path length.
Impact
An unauthenticated remote attacker could trigger a stack buffer overflow, with high impact on confidentiality, integrity and availability, potentially leading to code execution.
What the attacker needed
Network access to the router's web interface; no authentication needed
The fix
The vendor released a patch; the code should also bound-check the URL path length before copying it into the fixed buffer.
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 is a small reserved area of memory. The router copies part of the web address you request into a fixed-size area without checking how long it is, so a very long address spills over into neighbouring memory. This can crash the device or let an attacker run their own code, and it happens before any login is required.
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.