See how mongoose compares to other vendors in security performance
Mongoose is an embedded web server and network library. Prior to 7.22, the Mongoose MQTT broker tutorial's mgmqttnexttopic() function can read two bytes beyond msg->dgram.len when a malformed MQTT SUBSCRIBE packet supplies a topic position that does not leave enough bytes for the topic-length field. Because tutorials/mqtt/mqtt-server/main.c reads that field without validating the complete two-byte access against the datagram boundary, an unauthenticated remote MQTT client can trigger invalid memory access and crash the broker. This issue is fixed in 7.22.
Mongoose is an embedded web server and network library. In 7.23, Mongoose's mghttpparseheaders() in src/http.c can accept an HTTP/1 request after the fixed MGMAXHTTPHEADERS table is exhausted and silently omit later framing headers such as Content-Length or Transfer-Encoding. A conforming frontend can treat bytes as the first request body while Mongoose treats the request as bodyless and parses those bytes as a second request, enabling request smuggling and bypass of a frontend path ACL when the frontend preserves the late framing header. Earlier releases may also be affected, but their status has not been established. This issue is fixed in 7.24.
Mongoose is an embedded web server and network library. In 7.23, Mongoose's mghttpparseheaders() in src/http.c can accept an HTTP/1 request after the fixed MGMAXHTTPHEADERS table is exhausted and silently omit later framing headers such as Content-Length or Transfer-Encoding. A conforming frontend can treat bytes as the first request body while Mongoose treats the request as bodyless and parses those bytes as a second request, enabling request smuggling and bypass of a frontend path ACL when the frontend preserves the late framing header. Earlier releases may also be affected, but their status has not been established. This issue is fixed in 7.24.
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.
Mongoose is an embedded web server and network library. From 7.17 until 7.24, Mongoose's MGTLSBUILTIN client in src/tlsbuiltin.c can accept an attacker-controlled server certificate chain when configured with a single DER CA certificate and processing a peer-provided chain, because mgtlsverifycertsignature() can return a negative issuer-key parsing result that callers negate as though verification succeeded. A crafted issuer with the trusted CA subject and public-key bytes but an unparseable RSA encoding can pair with an attacker-self-signed leaf that is not signed by the trusted CA, allowing a redirected client connection to complete a TLS 1.3 handshake and exchange application data without the trusted CA private key. This issue is fixed in 7.24.
Mongoose is an embedded web server and network library. Prior to 7.23, ppphandleipv6cp() in src/l2ppp.c trusts the 16-bit IPv6CP len field without checking it against the received payload size. On a PPP or PPPoE link using MGENABLETCPIP and MGENABLEIPV6, an unauthenticated adjacent peer can complete the required LCP exchange and send a short Configure-Request with an oversized length, causing ppptxframe() to read beyond recvqueue.buf and write beyond tx.buf. The same length misuse can also expose adjacent heap bytes in a reply or hang the event loop through findopt(). This issue is fixed in version 7.23.
Mongoose is an embedded web server and network library. Prior to 7.23, the built-in TLS certificate parser selected by MGTLSBUILTIN fails to verify that a long-form DER element length fits within the remaining certificate buffer. In mgdertotlv() and mgdernext(), a peer-controlled length can advance the parser beyond the certificate and underflow the remaining uint32t length, causing mgtlsparsecertder() to continue walking an invalid pointer. An unauthenticated malicious TLS server, or a client presenting a certificate to a server configured for client certificates, can trigger an out-of-bounds read and denial of service during the handshake. This issue is fixed in version 7.23.
Mongoose is an embedded web server and network library. Prior to 7.22, an attacker who can control an SSI-enabled file can place directory traversal sequences in an #include file or #include virtual directive. The mgssi() function in src/ssi.c concatenates the directive argument into a filesystem path without calling mgpathissane(), allowing an MGENABLESSI deployment with ssipattern configured to disclose files readable by the Mongoose process. This issue is fixed in version 7.22.
Mongoose is an embedded web server and network library. Prior to 7.22, an attacker who can create a file with an HTML payload in its name can trigger stored cross-site scripting when a user browses a directory served with MGENABLEDIRLIST. The printdirentry() path called by listdir() in src/http.c URL-encodes the href but inserts the raw filesystem filename into the HTML link text. The browser executes the injected markup in the Mongoose origin, which can expose session data or permit actions as the victim. This issue is fixed in version 7.22.
Mongoose is an embedded web server and network library. Prior to 7.22, a remote attacker can place a lone carriage return or line feed in multipart input processed by mghttpnextmultipart() in src/http.c. The loops comparing s[b] and s[b + 1], and s[h2] and s[h2 + 1], use an incorrect AND condition and stop when either character resembles part of a CRLF terminator. This truncates headers, filenames, or boundaries and can cause an application to accept dangerous content after seeing a misleading Content-Type value. This issue is fixed in version 7.22.
Mongoose is an embedded web server and network library. Prior to 7.22, a remote attacker can place a lone carriage return or line feed in multipart input processed by mghttpnextmultipart() in src/http.c. The loops comparing s[b] and s[b + 1], and s[h2] and s[h2 + 1], use an incorrect AND condition and stop when either character resembles part of a CRLF terminator. This truncates headers, filenames, or boundaries and can cause an application to accept dangerous content after seeing a misleading Content-Type value. This issue is fixed in version 7.22.
Mongoose is an embedded web server and network library. Prior to 7.23, a network attacker can impersonate a TLS server to a Mongoose client configured with a multi-certificate CA bundle. In src/tlsbuiltin.c, the mgtlsinit() function stores the bundle in tls->cabundleder while tls->cader.len remains zero, and mgtlsrecvcert() uses tlsbundlefind() to accept a Common Name match without calling mgtlsverifycertsignature(). A forged self-signed certificate can therefore satisfy hostname and CertificateVerify checks and enable interception, credential disclosure, traffic modification, and malicious responses. This issue is fixed in version 7.23.
Mongoose Web Server 6.9 contains a denial of service vulnerability that allows remote attackers to crash the service by establishing multiple socket connections. Attackers can repeatedly create connections to the default port and send malformed data to exhaust server resources and cause service unavailability.
An integer overflow vulnerability exists in the WebSocket component of Mongoose 7.5 thru 7.17. By sending a specially crafted WebSocket request, an attacker can cause the application to crash. If downstream vendors integrate this component improperly, the issue may lead to a buffer overflow.