CVE-2026-141472: Mongoose: Pre-authentication heap out-of-bounds read in built-in TLS ClientHello extension parsing
Mongoose is an embedded web server and network library. Prior to 7.24, a remote unauthenticated TLS client can cause a heap out-of-bounds read in mgtlsserverrecvhello() in src/tlsbuiltin.c and the generated mongoose.c when Mongoose uses MGTLSBUILTIN and a ClientHello extension block ends with fewer than four bytes. The parser reads the extension length before checking that the type and length header is complete, and related key-share length reads also lack minimum-structure validation, allowing a malformed handshake to terminate the worker or process. This issue is fixed in 7.24.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 7.24
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using Cesanta Mongoose prior to version 7.24 are affected only when configured to use the built-in TLS implementation, MG_TLS_BUILTIN. The vulnerable parsing occurs while handling TLS ClientHello messages.
What does an attacker need to exploit it?
An attacker only needs to be able to connect as an unauthenticated TLS client and send a malformed ClientHello whose extension block ends with fewer than four bytes. No prior authentication is required.
What is the practical impact of a successful attempt?
Malformed handshake data can trigger a heap out-of-bounds read and terminate the Mongoose worker or process. This creates a remote denial-of-service condition.
What should be done if immediate patching is not possible?
The provided information identifies version 7.24 as the fix. Until it can be deployed, reduce exposure of TLS endpoints using MG_TLS_BUILTIN to untrusted remote clients where possible.