Cesanta Mongoose
cpe:2.3:a:cesanta:mongoose:*:*:*:*:*:*:*
- <= 7.20
A stack-based buffer overflow vulnerability has been identified in Cesanta Mongoose versions prior to 7.21. The issue arises in the mDNS record handling function within 'mongoose.c', where a fixed-size stack buffer is used to construct responses. This buffer can be overflowed by manipulating the response data, leading to potential corruption of the stack and execution control.
Exploitation of this vulnerability causes a stack-based buffer overflow, overwriting saved registers and the return address on the MIPS stack. This corruption leads to a crash when the function returns, as execution jumps to a corrupted address.
The vulnerability can be reproduced by sending a standard mDNS PTR query for a service type to UDP port 5353. The server responds by building a PTR response that includes additional DNS records (SRV, TXT, and A) which collectively exceed the buffer size, causing the overflow. This can be automated with a Python script that sends the crafted mDNS query and checks if the server crashes.
Users are advised to upgrade to Cesanta Mongoose version 7.21, which addresses this vulnerability.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.