chonked pt.1: minidlna 1.3.2 http chunk parsing heap overflow (cve-2023-33476) root cause analysis
MiniDLNA's HTTP chunked encoding parser mishandles chunk sizes, allowing a chunk size larger than the request buffer. A crafted request causes an out-of-bounds read/write on the heap.
This post will go over the details and root cause of a heap buffer overflow vulnerability I discovered in the HTTP chunk parsing code of MiniDLNA, affecting up to version 1.3.2. This vulnerability can be exploited to achieve remote code execution in the context of the user that the minidlna server is running as.
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a missing pair of parentheses in a while loop condition causes the result of a comparison (a boolean) to be stored instead of the parsed chunk size, so the size validation is ineffective.
Impact
An attacker could cause an out-of-bounds read/write on the heap, potentially crashing the server.
What the attacker needed
Network access to the MiniDLNA server; Server running a vulnerable version
How it was found
- Send an HTTP request with the Transfer-Encoding:chunked header.
- Include a chunk size value that is much larger than the total request length.
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 write-up has not been written yet. The Original tab links to the source.
MiniDLNA is a media server that can be tricked into reading and writing beyond the memory it allocated for an incoming request. This happens because a check on the size of data chunks is flawed, so a very large size is accepted. An attacker could crash the server.
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.