Asuswrt and Asuswrt-Merlin New Gen httpd unescape memory corruption vulnerability
The httpd unescape function in Asuswrt and Asuswrt-Merlin New Gen assumes that every percent sign is followed by two characters, so a crafted HTTP request ending with a percent sign and one character causes an out-of-bounds read and can remove the null terminator, leading to an out-of-bounds write. An attacker could send a network request to trigger memory corruption.
Originally disclosed on Cisco Talos
A memory corruption vulnerability exists in the httpd unescape functionality of Asuswrt prior to 3.0.0.4.38648706 and Asuswrt-Merlin New Gen prior to 386.7.. A specially-crafted HTTP request can lead to memory corruption.
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 unescape function does not check that two characters follow a percent sign before reading and shifting the string, causing an out-of-bounds read and possible removal of the null terminator that leads to an out-of-bounds write.
Impact
An attacker could send a network request to cause memory corruption, which may lead to a denial of service or potentially code execution, though the CVSS score indicates only low integrity impact.
What the attacker needed
Network access to the router's httpd
The fix
The vulnerability was fixed in the listed firmware versions by correcting the unescape function to handle incomplete percent-encoded sequences safely.
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.
The router's web server has a function that decodes special characters in web addresses. It wrongly assumes that a percent sign is always followed by two characters. If an attacker sends a request where a percent sign is followed by only one character, the function reads and writes past the end of a buffer, which can crash the router or corrupt memory.
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.