Technical impact
The flaw resides in the utility function mg_path_is_sane in Mongoose. Before version 7.22 the function accesses buffer bytes without first ensuring path len is at least two, enabling a one‑byte heap out‑of‑bounds read (CWE‑125). The attack also bypasses a null‑byte check, which is an Improper Null Termination issue (CWE‑158). An attacker can craft a short path when using mg_http_upload or mg_http_serve_dir to read an adjacent heap byte, potentially revealing sensitive data or triggering a crash.
Affected Systems
Affected systems are installations of the Mongoose embedded web server and network library from cesanta that are version 7.21 or older. The vulnerability is present on bare‑metal or RTOS targets that lack memory protection, as well as on all platforms where an unauthenticated client can invoke the upload or directory endpoints.
Risk and Exploitability
The CVSS score of 6.5 depicts a moderate severity. With no available EPSS data and not listed in KEV, exploitation is possible but no public exploits are documented. An unauthenticated remote attacker could trigger the read via HTTP requests to the vulnerable endpoints. The lack of memory protection on target devices could lead to leaks or crashes, but the exact impact depends on the surrounding memory layout. Patch status is critical to mitigate the risk.