Weston Embedded uC-HTTP HTTP Server memory corruption vulnerability
A one-byte NULL overwrite in the HTTP header parsing of uC-HTTP can corrupt a free-list pointer, allowing an attacker to allocate memory at an arbitrary address and potentially achieve code execution. An attacker can send a specially crafted HTTP header to trigger this vulnerability.
Originally disclosed on Cisco Talos
A memory corruption vulnerability exists in the HTTP Server header parsing functionality of Weston Embedded uC-HTTP v3.01.01. Specially crafted network packets can lead to 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 length check uses '>' instead of '>=' so a value exactly equal to the buffer size passes, and the subsequent NULL termination writes one byte out of bounds.
Impact
An attacker could achieve arbitrary memory allocation and potentially code execution, though the CVSS vector indicates high attack complexity.
What the attacker needed
Network access to the HTTP server; ability to send crafted HTTP headers
The fix
The vendor released a patch that changes the length check from '>' to '>=' to prevent the off-by-one overwrite; a workaround is to use the OnReqHdrRxHook callback to reject unnecessary headers.
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 small HTTP server used in embedded devices. When the server processes a header value that is exactly as long as its buffer, it writes a zero byte just past the end of the buffer. That single byte can corrupt a pointer used to track free memory, letting an attacker control where the next memory allocation happens and potentially 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.