# CVE-2021-31875: In mjsjson.c in Cesanta MongooseOS mJS 1.26, a maliciously formed JSON string can trigger an off-by-one heap-based buffer overflow in mjsjs…

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.17%, higher than 82% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-04-29T00:00:00.000Z
- Modified: 2026-06-17T03:52:23.537Z
- Weaknesses: CWE-193, CWE-787
- Assigned by: mitre

## 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."

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- cesanta mongooseos_mjs: 1.26

## Every score

- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://huntr.dev/bounties/1-other-mjs/> (exploit, third-party-advisory)
- <https://github.com/418sec/mjs/pull/2> (patch, third-party-advisory)
- <https://github.com/cesanta/mjs/releases/tag/1.26> (release-notes, third-party-advisory)

## Sources

- CVE List: [CVE-2021-31875](https://www.cve.org/CVERecord?id=CVE-2021-31875), CVE Terms of Use, modified 2024-08-03
- NVD: [CVE-2021-31875](https://nvd.nist.gov/vuln/detail/CVE-2021-31875), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-31875 · Whole record: https://cve.day/CVE-2021-31875.json · Rebuilt by cve.day 2026-11-25T22:58:01.083Z
