Skip to content
Mongoose

Mongoose

Tenable •Joshua Martinelle • November 24, 2026

Mongoose - Improper Validation of Array Index in X.509 Certificate Validity Date Parsing

Note: This vulnerability was independently discovered by Tenable Research and other researchers. Note: The CVSS vector differs from our own assessment ( C:H/I:N/A:H ). We score the 64-bit crash as an availability impact, which the vendor advisory does not. In Mongoose, the built-in TLS stack ( MG_TLS=MG_TLS_BUILTIN ) parses the validity timestamps of a peer's X.509 certificate with asnt2t() , which hands the result to mg_timegm() without validating the month field. A remote, unauthenticated peer can trigger an out-of-bounds read during the TLS handshake. The upstream DER checks only look at the ASN.1 type tag ( 0x17 or 0x18 and the length (13 or 15 bytes), never at the content. asnt2t() then reads the digits straight from the certificate bytes. A timestamp such as 20250015120000Z , which has a month value of 0, therefore reaches mg_timegm() unchecked. The mg_timegm() function in src/util.c uses the dm[12] table of cumulative day counts per month and indexes it with month - 1 . With a month of 0, the unsigned arithmetic wraps and produces the index 4294967295 , which is far outside the bounds of the array. The consequences depend on the architecture. On 32-bit embedded targets, the read lands at a predictable offset from the dm array, which leaks memory contents. The returned value feeds into the certificate validity check (accept or reject), so an attacker can use different month values as an oracle to infer what is in memory at those addresses. On 64-bit systems, the read crashes the process, which results in a denial of service. Joshua Martinelle

Tue, 11/24/2026 - 03:15