Skip to content
Memory corruption Advisory Advanced CVE-2023-31272

Yifan YF325 httpd do_wds stack-based buffer overflow vulnerability

The router's httpd do_wds function copies the URL path after the first dash into a fixed-size stack buffer using strcpy without checking length. An unauthenticated attacker could send a crafted network request to overflow the buffer and potentially execute code.

Francesco Benvenuto Follow

Originally disclosed on Cisco Talos

High 8.8 View original

A stack-based buffer overflow vulnerability exists in the httpd dowds functionality of Yifan YF325 v1.020221108. A specially crafted network request can lead to stack-based buffer overflow.

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

The do_wds handler uses strcpy to copy an attacker-controlled portion of the URL path into a fixed-size stack buffer without any length check.

Impact

An unauthenticated attacker could send a crafted request to overflow the stack buffer, potentially leading to code execution on the device; the CVSS score reflects high confidentiality, integrity and availability impact.

What the attacker needed

Network access to the router's httpd; no authentication required

The fix

The vendor released a patch on 2023-10-24, though the text does not describe what the patch changed.

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 router runs a small web server that handles requests to its management pages. One of its request handlers copies part of the web address into a fixed-size space in memory without checking how long it is, so a very long address spills over into neighbouring memory. That spill can crash the device or let an attacker take control of it, and no login is needed to try.

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.

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.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.