CVE-2026-73252: Mongoose: Unauthenticated remote heap out-of-bounds read in built-in TLS: off-by-one length check in mg_tls_recv_record() underflows recv_len to SIZE_MAX
Mongoose is an embedded web server and network library. Prior to 7.23, the built-in TLS stack selected by MGTLSBUILTIN in src/tlsbuiltin.c accepts a TLS 1.3 record whose decrypted size is exactly the 16-byte authentication tag with no plaintext or ContentType byte. In mgtlsrecvrecord(), the msgsz length check permits that record and the recvlen calculation underflows to SIZEMAX, so a later handshake step treats stale buffer contents as a trusted message with an effectively unbounded length. An unauthenticated malicious TLS peer can trigger a heap out-of-bounds read before certificate or Finished validation, causing a remote denial of service. This issue is fixed in version 7.23.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Mongooseto a version that resolves this vulnerability.Fixed in 7.23
Event History
Frequently Asked Questions
Which deployments are affected?
Affected deployments use Mongoose versions before 7.23 with the built-in TLS stack selected by MG_TLS_BUILTIN. The vulnerable code is in src/tls_builtin.c.
Does exploitation require authentication or a completed TLS handshake?
No. An unauthenticated malicious TLS peer can trigger the issue before certificate or Finished validation.
What is the practical impact of exploitation?
The underflow can cause a later handshake step to treat stale buffer data as a message with an effectively unbounded length, leading to a heap out-of-bounds read and remote denial of service.
What should teams do if they are vulnerable?
Upgrade Mongoose to version 7.23, which fixes the issue. Prioritize systems that expose built-in TLS services to untrusted network peers.