Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2024-21541

Versions of the package dom-iterator before 1.0.1 are vulnerable to Arbitrary Code Execution due to use of the Function constructor without complete input sanitization. Function generates a new function body and thus care must be given to ensure that the inputs to Function are not attacker-controlled. The risks involved are similar to that of allowing attacker-controlled input to reach eval.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-21541
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 05:57 UTC · Revision 1

Source evidence

CVE-2024-21541

core-osv · Original source

Published 13 Nov 2024, 05:00 UTC

Versions of the package dom-iterator before 1.0.1 are vulnerable to Arbitrary Code Execution due to use of the Function constructor without complete input sanitization. Function generates a new function body and thus care must be given to ensure that the inputs to Function are not attacker-controlled. The risks involved are similar to that of allowing attacker-controlled input to reach eval.

osv:CVE-2024-21541
Complete source record
{
  "id": "1b787e34b17727389ff3f74992fd7d7376e1e8ccb0828ac7f4ce562a698f7536",
  "url": "https://osv.dev/vulnerability/CVE-2024-21541",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2024-21541",
    "summary": "Versions of the package dom-iterator before 1.0.1 are vulnerable to Arbitrary Code Execution due to use of the Function constructor without complete input sanitization. Function generates a new function body and thus care must be given to ensure that the inputs to Function are not attacker-controlled. The risks involved are similar to that of allowing attacker-controlled input to reach eval.",
    "evidence": "osv:CVE-2024-21541",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2024-21541",
      "aliases": [
        "CVE-2024-21541",
        "GHSA-jrvm-mcxc-mf6m"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/matthewmueller/dom-iterator",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "9e0e0fad5a251de5b42feb326c4204eb04080805"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:matthewmueller:dom-iterator:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "1.0.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "9e0e0fad5a251de5b42feb326c4204eb04080805"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.0.0",
            "0.3.0",
            "0.2.1",
            "0.2.0",
            "0.1.1",
            "0.1.0",
            "0.0.5",
            "0.0.4",
            "0.0.3",
            "0.0.2",
            "0.0.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-21541.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:26.110347263Z",
      "provider": "osv",
      "references": [
        "https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-8383166",
        "https://security.snyk.io/vuln/SNYK-JS-DOMITERATOR-6157199",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/21xxx/CVE-2024-21541.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-21541",
        "https://github.com/matthewmueller/dom-iterator/commit/9e0e0fad5a251de5b42feb326c4204eb04080805"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-94"
        ],
        "cna_assigner": "snyk",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "*"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandardRange"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/21xxx/CVE-2024-21541.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-21541",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 492849,
  "published_at": "2024-11-13T05:00:12.27+00:00"
}