Weston Embedded uC-HTTP HTTP Server heap-based buffer overflow vulnerability
A heap-based buffer overflow occurs when parsing the HTTP protocol version if the version string is preceded by non-printable bytes, causing an integer underflow in the remaining buffer length. An attacker can send a crafted packet to trigger the overflow and potentially achieve arbitrary code execution.
Originally disclosed on Cisco Talos
A heap-based buffer overflow vulnerability exists in the HTTP Server functionality of Weston Embedded uC-HTTP git commit 80d4004. A specially crafted network packet 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 code subtracts the number of skipped characters from the remaining buffer length twice, leading to an integer underflow when the skipped count exceeds the remaining length.
Impact
An attacker could exploit this to gain arbitrary code execution, though the report does not demonstrate a full exploit beyond a crash.
What the attacker needed
Network access to the HTTP server
The fix
The code should be modified to correctly update the remaining buffer length by using the adjusted length variable instead of the pointer difference.
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 is a memory corruption bug in a web server used in embedded systems. When the server reads the HTTP version part of a request, it mishandles certain unusual characters, causing it to miscalculate how much space is left in its buffer. That miscalculation lets an attacker write more data than the buffer can hold, which can crash the server or let the 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.