Skip to content
Mongoose - Use of Out-of

Mongoose - Use of Out-of

Tenable •Joshua Martinelle • November 24, 2026

Mongoose - Use of Out-of-range Pointer Offset in X.509 Certificate ECDSA Signature Parsing

In Mongoose, the built-in TLS stack ( MG_TLS=MG_TLS_BUILTIN ) parses the ECDSA signature of a peer's X.509 certificate in mg_tls_verify_cert_signature() ( src/tls_builtin.c ). The function copies the signature integers ( r and s ) using the attacker-supplied DER length fields without validating them against the actual buffer bounds. A remote, unauthenticated peer can trigger an out-of-bounds read, and a crash, during the TLS handshake. The ASN.1 DER encoding of the signature allows a length to be expressed in long form. A certificate whose signature declares an oversized length for the first INTEGER ( r ) is not rejected. For example, replacing 02 21 with 02 83 A0 00 00 declares a length of 10,485,760 bytes. mg_tls_verify_cert_signature() uses this value directly to copy data and advance its pointer. The memmove then reads far past the end of the signature buffer. The parsing happens in mg_tls_recv_cert() , before the signature or the trust chain is verified. A self-signed, untrusted certificate is therefore enough to reach the vulnerable code. The server must be built with the built-in TLS stack and configured to parse a peer certificate (for example, mg_tls_opts.ca is set so that the server requests a client certificate). The impact is a remote, unauthenticated denial of service. A single TLS handshake carrying the crafted certificate crashes the process with a SIGSEGV . This was reproduced both with AddressSanitizer and with a plain, non-instrumented build, where the process exits with code 139. Joshua Martinelle

Tue, 11/24/2026 - 03:23

Extracted Entities

Attack Types (1)

CWE Weaknesses (1)

Vulnerabilities (1)