Milesight UR32L vtysh_ubus sprintf pattern buffer overflow vulnerabilities
Multiple stack-based buffer overflows exist in the vtysh_ubus binary of Milesight UR32L v32.3.0.5 because user-controlled JSON values are passed to sprintf without length checks. An authenticated high-privilege attacker can send crafted HTTP requests to crash the service and potentially execute arbitrary code.
Originally disclosed on Cisco Talos
Multiple buffer overflow vulnerabilities exist in the vtyshubus binary of Milesight UR32L v32.3.0.5 due to the use of an unsafe sprintf pattern. A specially crafted HTTP request can lead to arbitrary 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 vtysh_ubus binary uses sprintf to copy user-supplied JSON string values into a fixed-size stack buffer without bounds checking.
Impact
An attacker with high privileges could crash the vtysh_ubus service and potentially execute arbitrary code on the router.
What the attacker needed
High-privilege authenticated user; network access to the router's web interface
How it was found
- Send a POST request to the /cgi endpoint with JSON data containing a core, function, and values.
- Include a value field with a long string (e.g., 0x300 bytes) for a vulnerable key such as src, dmz, old_ip, old_mac, ip, mac, description, to_dst, dport, to_dport, interface, class_name, rule_name, or attach_class.
- The vtysh_ubus binary parses the JSON and passes the string to sprintf, causing a buffer overflow.
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 writes more data into a fixed-size memory area than it can hold, corrupting nearby memory. Here, the router's web interface takes long text from a logged-in admin and copies it into a small buffer without checking the length, which can crash the router or let an attacker run their own 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.