CVE-2022-21122 json
Arbitrary Code Execution
published 2022-06-03 4 y ago modified 2026-09-10 1 mo ago also GHSA-5gc4-cx9x-9c43 , EUVD-2022-5939
- cvss
- 9.0
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.7%
- EPSS 2.7% chance of exploitation in 30 days, percentile 85%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- npm metacalc 0.0.2
- n/a metacalc 0.0.2
- github.com/metarhia/metacalc@625c23d commit
- github.com/metarhia/metacalc#16 pull request
Exploit prediction
2.68% chance of exploitation in the next 30 days, higher than 85% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- snyk.io https://snyk.io/vuln/SNYK-JS-METACALC-2826197 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 9.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P |
| CNA | 3.1 | 9.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
| GitHub | 3.1 | 9.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | metacalc | <0.0.2 |
0.0.2 |
Affected products
- n/a metacalc
Classification
- Weakness
-
- CWE-94 Improper Control of Generation of Code
References
-
github.com
/metarhia/metacalc/pull/16
web, patch, third-party-advisory
-
github.com
/metarhia/metacalc/commit/625c23d63eabfa16fc815f5832b147b08d2144bd
web, patch, third-party-advisory
-
snyk.io
/vuln/SNYK-JS-METACALC-2826197
web, exploit, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2022-21122
advisory
-
github.com
/metarhia/metacalc
package
Sources
- CVE List CVE-2022-21122
- GitHub Advisory GHSA-5gc4-cx9x-9c43
- NVD CVE-2022-21122
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.