Realtek rtl819x Jungle SDK boa updateConfigIntoFlash integer overflow vulnerability
The boa web server in the Realtek rtl819x Jungle SDK multiplies two attacker-controlled values from an uploaded configuration file to size a heap allocation without checking for overflow. A crafted upload can therefore allocate too little memory and overflow the heap during decompression, potentially leading to arbitrary code execution.
Originally disclosed on Cisco Talos
An integer overflow vulnerability exists in the boa updateConfigIntoFlash functionality of Realtek rtl819x Jungle SDK v3.4.11. A specially crafted series of HTTP requests 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 product of the file-supplied compression length and compression rate is used as a malloc size without any overflow check before decompression writes into the buffer.
Impact
An attacker with authenticated access to the router's web interface could achieve arbitrary code execution on the device.
What the attacker needed
Authenticated access to the web interface; ability to upload a configuration file
The fix
Realtek provided updated software to its customers, but LevelOne declined to patch the affected router.
How it was found
- Send an HTTP request to the configuration upload endpoint with a file whose header contains the expected magic value.
- Set the compression length and compression rate fields in the header so their product overflows to a small allocation size.
- Let the server decompress the file into the undersized buffer, overflowing the heap.
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 accepts a configuration file and uses two numbers inside it to decide how much memory to reserve. If those numbers are chosen so their product wraps around to a small value, the router reserves too little space and then writes more data than fits, corrupting memory. An attacker who can log in to the router could use this to run their own code on it.
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.