CVE-2026-134170 in Mongoose
Summary
by MITRE • 11/21/2026
Cesanta Mongoose 7.22 before 7.24 with the built-in TLS stack contains an out-of-bounds read in mg_timegm() that allows remote attackers to crash the process via crafted X.509 certificate validity months. Attackers can present a certificate with month '00' or out-of-range values during the handshake, before signature verification, causing an unchecked dm array index and denial of service.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 11/21/2026
The vulnerability identified in Cesanta Mongoose versions prior to 7.24 represents a critical security flaw within its integrated TLS stack, specifically manifesting as an out-of-bounds read during the processing of X.509 certificate validity periods. This issue is rooted in the mg_timegm function, which is responsible for converting time structures into Unix timestamps. When a remote attacker presents a maliciously crafted X.509 certificate containing invalid month values such as zero or numbers outside the standard one-to-twelve range during the TLS handshake phase, the library fails to perform adequate bounds checking on the underlying day-of-month array index. This lack of validation allows the application to access memory locations beyond the allocated buffer boundaries, leading directly to a denial of service condition by crashing the affected process before any signature verification can occur.
From a technical perspective, this flaw is classified under CWE-125, which denotes an out-of-bounds read vulnerability. The root cause lies in the absence of rigorous input validation for date components extracted from the certificate's validity fields. During the TLS handshake, particularly when negotiating secure connections using mutual authentication or standard server verification, the client or server parses the certificate details to establish trust and session parameters. By injecting a month value that results in an invalid index into the internal day array used by mg_timegm, the attacker triggers undefined behavior within the C runtime environment. This typically manifests as segmentation faults or access violations, causing immediate termination of the application thread or process handling the connection. The vulnerability is particularly dangerous because it can be exploited before cryptographic signature verification takes place, meaning that an attacker does not need valid credentials to trigger the crash, thereby facilitating easy remote exploitation against any service relying on this version of Mongoose for TLS operations.
The operational impact of this vulnerability is primarily a denial of service affecting availability and reliability. Since the exploit requires only the transmission of a crafted certificate during the handshake phase, it can be automated and launched at scale to disrupt services that depend on Cesanta Mongoose for secure communications. For applications handling high volumes of incoming connections or operating in untrusted network environments, such as public-facing web servers or IoT gateways, this vulnerability poses a significant risk. An attacker could systematically send malformed certificates to exhaust system resources through repeated process restarts or simply render the service unavailable by causing continuous crashes. This undermines the core security principle of availability and can lead to substantial downtime and loss of trust in systems that rely on Mongoose for their TLS implementation.
To mitigate this vulnerability, organizations must immediately upgrade Cesanta Mongoose to version 7.24 or later, where the issue has been resolved through improved input validation within the mg_timegm function. Developers should ensure that all dependencies are updated and verified against known vulnerable versions. In environments where an immediate patch is not feasible, implementing a network-level filter such as a Web Application Firewall can help by inspecting TLS handshake payloads for anomalous certificate structures or rejecting connections with invalid date fields before they reach the application layer. Additionally, enabling robust logging and monitoring for process crashes related to TLS handshakes can aid in detecting potential exploitation attempts while mitigation strategies are deployed. This incident underscores the importance of rigorous input validation within cryptographic libraries and highlights the necessity of keeping third-party security components up to date to prevent remote code execution or denial of service attacks as categorized under MITRE ATT&CK techniques involving resource exhaustion via protocol abuse.