Skip to content
Heist/ feed
Back to feed
Critical

Arbitrary Code Execution

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2022-21122
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 14:54 UTC · Revision 1

Source evidence

Arbitrary Code Execution

core-osv · Original source

Published 3 Jun 2022, 20:05 UTC

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.

osv:CVE-2022-21122
Complete source record
{
  "id": "4ebf82df201c0b439e390d24cf989af63ae44c535387ae4c5e80d1fe4533a6ea",
  "url": "https://osv.dev/vulnerability/CVE-2022-21122",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Arbitrary Code Execution",
    "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.",
    "evidence": "osv:CVE-2022-21122",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2022-21122",
      "aliases": [
        "CVE-2022-21122",
        "GHSA-5gc4-cx9x-9c43",
        "SNYK-JS-METACALC-2826197"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/metarhia/metacalc",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "940be866d58a908507aa61611ba158752175d425"
                },
                {
                  "fixed": "625c23d63eabfa16fc815f5832b147b08d2144bd"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:metarhia:metacalc:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.0.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "625c23d63eabfa16fc815f5832b147b08d2144bd"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v0.0.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-21122.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:29.731953704Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21122.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-21122",
        "https://snyk.io/vuln/SNYK-JS-METACALC-2826197",
        "https://github.com/metarhia/metacalc/commit/625c23d63eabfa16fc815f5832b147b08d2144bd",
        "https://github.com/metarhia/metacalc/pull/16"
      ],
      "provider_metadata": {
        "cna_assigner": "snyk",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21122.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-21122",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 496563,
  "published_at": "2022-06-03T20:05:12.139+00:00"
}