CVE-2021-31875: Cesanta MongooseOS mJS - Buffer Overflow
- Cve: CVE-2021-31875
- Name: Cesanta MongooseOS mJS - Buffer Overflow
- Description: In mjs_json.c in Cesanta MongooseOS mJS 1.26, a maliciously formed JSON string can trigger an off-by-one heap-based buffer overflow in mjs_json_parse, which can potentially lead to redirection of control flow. NOTE: the original reporter disputes the significance of this finding because "there isn’t very much of an opportunity to exploit this reliably for an information leak, so there isn’t any real security impact."
- Impact: Potential control flow hijacking, but limited exploitation opportunity reduces security impact.
- Remediation: Update to the latest version of MongooseOS with patched JSON parsing functions.
- Vulnerability type: buffer_overflow
- Vulnerability impact: remote_code_execution
- Requirement type: none
- Labels source: projectdiscovery
- Severity: critical
- Cvss score: 9.8
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Epss score: 0.02174
- Epss percentile: 0.82656
- Assignee: [email protected]
- Published at: 2021-04-29T02:15:08Z
- Age in days: 2035
- Modified at: 2026-06-17T03:52:23Z
- Patch available: yes
- Public exploits total: 1
- References total: 3
- Products total: 1
- Oss: yes
- Projects total: 2
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-31875
- Nvd status: modified
- Checked, none or zero: known exploited entries, nuclei templates, public exploits capped, rejected by nvd
- Not known: requirements, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-193 | Off-by-one Error |
Public exploits
| Url | Source | Added date |
|---|---|---|
| https://huntr.dev/bounties/1-other-mjs/ | nvd | 2021-04-29 |
References
Same in every row:
- Source: nvd
| Url | Tags |
|---|---|
| https://github.com/418sec/mjs/pull/2 | Patch, Third Party Advisory |
| https://huntr.dev/bounties/1-other-mjs/ | Exploit, Third Party Advisory |
| https://github.com/cesanta/mjs/releases/tag/1.26 | Release Notes, Third Party Advisory |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| cesanta:mongooseos_mjs | = 1.26 | no | nvd | /v1/products/cesanta/mongooseos_mjs |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| cesanta/mjs | fix, releases | yes | /v1/repositories/cesanta/mjs |
| 418sec/mjs | pull | yes | /v1/repositories/418sec/mjs |
Index
- Checked, none or zero: repositories, repositories high signal, packages
Exploitation
- Public exploit: yes
- Public exploit count: 1
- Public exploit first date: 2021-04-29
- Remote: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, initial access, authentication required
- Not known: known exploited since, vulncheck known exploited since, nuclei template, initial access since, hackerone reports, exposed hosts