Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend HTTP request with short path (./.)
-
ExploitReach mg_http_upload or serve_dir
-
ExecutionTrigger OOB read in mg_path_is_sane
-
ImpactLeak adjacent heap byte or crash
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK
1 technique across 1 tactic: Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The affected application must call the public API functions mg_http_upload or mg_http_serve_dir (both documented in mongoose.h); any app using them inherits the bug. Exploitation is unauthenticated and remote (PR:N): the attacker supplies a request whose path has one of the specific short shapes - length-1 '.' (reaches Bug A in mg_http_upload), or two trailing bytes '/.' as in '/.' or 'x/.' (Bug B, reachable from both serve_dir and upload) - causing a 1-byte read past the mg_str buffer. Limiting factors: no code execution or integrity impact; the information-disclosure outcome is realistic only on bare-metal/RTOS targets lacking memory protection where the adjacent byte can leak or alter the sane/insane decision, whereas on memory-protected hosts the over-read is usually benign and only produces a crash under instrumented (e.g. ASAN) builds. Versions <= 7.21 are affected; 7.22 fixes it. |
| Impact | Signals are mostly consistent and point to a genuine but moderate-priority issue. The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L, base 6.5) indicates remote, low-complexity, unauthenticated reachability - PR:N confirms no authentication is required - but with only Low confidentiality and Low availability impact and no integrity impact, matching the one-byte heap out-of-bounds read described. There is no KEV listing and no EPSS score in the supplied data, so widespread or active exploitation is neither confirmed nor estimable from these inputs. A concrete PoC exists (a self-contained Docker/AddressSanitizer reproducer confirmed against Mongoose 7.21), which raises practical reproducibility, but it demonstrates ASAN-detected OOB-read crashes rather than data exfiltration or code execution. The vuln.today decision label is 'this_month', not act_now or emergency, consistent with a real-but-not-critical finding. Importantly, the real-world impact is conditional: the GHSA states meaningful information disclosure occurs on bare-metal/RTOS targets without memory protection, while on hosts with memory protection the one-byte over-read is typically benign and only crashes under instrumentation - so the Low confidentiality rating may overstate impact for most server-class deployments and understate it for unprotected embedded targets. Net: a legitimate patch-this-month issue for embedded users, not a high-urgency emergency. |
| Exploit ScenarioDerived | An unauthenticated remote attacker sends an HTTP request containing a specially short path shape (e.g. '.', '/.', or 'x/.') to an application that exposes mg_http_upload or mg_http_serve_dir, causing mg_path_is_sane to read one byte past the path buffer. On an embedded bare-metal/RTOS target without memory protection this can leak the adjacent heap byte or flip the path accept/reject decision; on instrumented builds it crashes. A working PoC reproducer (Docker + AddressSanitizer against 7.21) is publicly referenced in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 04, 2026
Heap out-of-bounds reads in the mg_path_is_sane() path validator of Cesanta Mongoose through 7.21 let unauthenticated remote requests read one byte past the end of a heap buffer, because the function checks path.buf[1] and s[2] without first confirming two or three bytes remain. Any application exposing mg_http_upload() or mg_http_serve_dir() inherits the flaw; a request whose path is a bare '.' or ends in '/.' (for example '/.', 'x/.' or '/upload?file=.') reaches the over-read, which on bare-metal or RTOS targets without memory protection can leak an adjacent heap byte or flip the sane/insane decision, while on memory-protected hosts the result is usually benign and crashes only under instrumented builds such as ASAN. A public PoC reference exists in the form of a self-contained ASAN Docker reproducer confirming the over-read against 7.21; it is not verified as working exploit code, and no active exploitation (CISA KEV) or public exploit tooling is reported. Fix is released in 7.22.
RemediationAI
Vendor-released patch: Mongoose 7.22 (release tag https://github.com/cesanta/mongoose/releases/tag/7.22, fixing commit https://github.com/cesanta/mongoose/commit/b55de8b151d1466a3e41d1f854f22eeb6faa23dc, advisory https://github.com/cesanta/mongoose/security/advisories/GHSA-cjmx-764f-286c). Upgrade the vendored mongoose.c/mongoose.h pair to the 7.22 sources - because the library is embedded, this means rebuilding and reflashing firmware, so plan a maintenance window; note the patched function also newly rejects paths containing an embedded NUL and treats empty paths as sane, which is a behavior change worth re-running path-handling tests against. Where an upgrade cannot be staged immediately, the advisory's suggested code fix can be back-ported by hand into mg_path_is_sane: guard the buf[1] access with len >= 2, tighten the loop guard so s[2] is only read when n >= 3, and reject len == 0 up front; the trade-off is a locally maintained patch that must be re-applied on every future library update. Applications that do not call mg_http_upload or mg_http_serve_dir do not expose the vulnerable paths and can schedule the update with normal maintenance; there is no vendor-provided configuration switch that disables the affected code path.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Mongoose is an embedded HTTP/network library for C, and its path sanity check lives in src/util.c as mg_path_is_sane(const struct mg_str path), operating on the library's mg_str type - a (buf, len) pair that is not guaranteed to be NUL-terminated and whose length is attacker-influenced through the parsed request path. The flaw is CWE-125 (out-of-bounds read) and exists in two variants. Bug A at the second byte check reads path.buf[1] to detect a leading '..' without verifying path.len >= 2, so a one-byte path '.' produces a one-byte over-read. Bug B inside the loop guard checks only n >= 2 before the body dereferences s[2] to detect a '/..' subdirectory, so when exactly two bytes remain ('/.') the third byte is read past the end of the mg_str region. Both are reachable from the documented public API: mg_http_serve_dir (http.c:806, constructed via mg_str_n(path, path_size)) exercises Bug B, and mg_http_upload (http.c:963, via mg_str(file)) exercises both. The root cause is a mismatch between the length checks and the bytes actually dereferenced, compounded by the loop's assumption that a NUL terminator or padding exists beyond len. The upstream commit b55de8b151d1466a3e41d1f854f22eeb6faa23dc rewrites the function to short-circuit on n == 0 or an empty string, guard the second byte with n > 1, require n > 2 before touching s[2], and additionally reject paths containing an embedded NUL (n > 0 after the loop), with regression tests using mg_str_n on 1-, 2- and 3-byte buffers. There is no write primitive and no integrity path: exposure is the single adjacent heap byte and the possibility that it changes the accept/reject decision for the path.
Know when Mongoose gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
Unauthenticated remote request reaches the parser (AV:N/AC:L/PR:N/UI:N); a 1-byte OOB read gives limited info disclosure (C:L) and possible crash (A:L), no integrity impact.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
Mongoose is an embedded web server and network library. Prior to 7.22, mg_path_is_sane in src/util.c read path.buf[1] without first requiring path.len to be at least two and read s[2] when only two bytes remained. Unauthenticated remote requests reaching mg_http_upload or mg_http_serve_dir with the affected short path shapes could therefore trigger one-byte heap out-of-bounds reads. On bare-metal or RTOS targets without memory protection, the adjacent byte could be exposed or influence whether a path was accepted, and instrumented builds could crash. This issue is fixed in version 7.22.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Mongoose ODM for Node.js before version 8.9.5 contains a search injection vulnerability when using $where filters with p
An exploitable stack buffer overflow vulnerability exists in the MQTT packet parsing functionality of Cesanta Mongoose 6
An exploitable use-after-free vulnerability exists in the HTTP server implementation of Cesanta Mongoose 6.8. Rated crit
An exploitable memory corruption vulnerability exists in the Websocket protocol implementation of Cesanta Mongoose 6.8.
An exploitable memory corruption vulnerability exists in the Websocket protocol implementation of Cesanta Mongoose 6.8.
Prototype Pollution in GitHub repository automattic/mongoose prior to 7.3.4. Rated critical severity (CVSS 9.8), this vu
Prototype Pollution in GitHub repository automattic/mongoose prior to 6.4.6. Rated critical severity (CVSS 9.8), this vu
An integer overflow in parse_mqtt in mongoose.c in Cesanta Mongoose 6.16 allows an attacker to achieve remote DoS (infin
Mongoose before 8.8.3 can improperly use $where in match, leading to search injection. Rated critical severity (CVSS 9.1
The mg_tls_init function in Cesanta Mongoose HTTPS server 7.0 (compiled with OpenSSL support) is vulnerable to remote OO
The mg_tls_init function in Cesanta Mongoose HTTPS server 7.0 and 6.7-6.18 (compiled with mbedTLS support) is vulnerable
The mg_http_serve_file function in Cesanta Mongoose HTTP server 7.0 is vulnerable to remote OOB write attack via connect
EUVD-2026-117180
NVD
CVE.org
EPSS
GitHub
Exploit-DB