# CVE-2022-21122: Arbitrary Code Execution

- Severity: Critical 9.0 (CVSS:3.1, scored by snyk) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P`
- 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.68%, higher than 86% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-06-03T20:05:12.139Z
- Modified: 2026-09-10T03:49:49.229Z
- Also known as: GHSA-5gc4-cx9x-9c43, SNYK-JS-METACALC-2826197
- Weaknesses: CWE-94
- Assigned by: snyk

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

(As written by CVE List.)

## Affected

- metacalc: from unspecified before 0.0.2
- metacalc (npm): before 0.0.2
- metarhia metacalc: before 0.0.2

## Every score

- snyk: CVSS:3.1 9.0 Critical `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P`
- GitHub: CVSS:3.1 9.0 Critical `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H`
- 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://snyk.io/vuln/SNYK-JS-METACALC-2826197> (exploit, third-party-advisory, web)
- <https://github.com/metarhia/metacalc/pull/16> (patch, third-party-advisory, web)
- <https://github.com/metarhia/metacalc/commit/625c23d63eabfa16fc815f5832b147b08d2144bd> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-21122> (advisory)
- <https://github.com/metarhia/metacalc> (package)

## Sources

- CVE List: [CVE-2022-21122](https://www.cve.org/CVERecord?id=CVE-2022-21122), CVE Terms of Use, modified 2024-09-16
- GitHub Advisory Database: [GHSA-5gc4-cx9x-9c43](https://github.com/advisories/GHSA-5gc4-cx9x-9c43), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2022-21122](https://nvd.nist.gov/vuln/detail/CVE-2022-21122), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-21122 · Whole record: https://cve.day/CVE-2022-21122.json · Rebuilt by cve.day 2026-11-25T22:58:12.157Z
