# CVE-2024-21541: dom-iterator code execution vulnerability

- Severity: Medium 6.9 (CVSS:4.0, scored by snyk) `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`
- 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): 1.08%, higher than 66% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-11-13T05:00:12.270Z
- Modified: 2026-06-17T07:09:42.403Z
- Also known as: GHSA-jrvm-mcxc-mf6m
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: snyk

## Description

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.

(As written by CVE List.)

## Affected

- dom-iterator: before 1.0.1
- org.webjars.npm:dom-iterator: before *
- dom-iterator dom-iterator: before *
- dom-iterator (npm): before 1.0.1
- matthewmueller dom-iterator: up to 1.0.0

## Every score

- snyk: CVSS:4.0 6.9 Medium `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`
- snyk: CVSS:3.1 7.3 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/E:P`
- GitHub: CVSS:3.1 7.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L`
- GitHub: CVSS:4.0 Medium `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`
- 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`

## References

- <https://security.snyk.io/vuln/SNYK-JS-DOMITERATOR-6157199> (exploit, third-party-advisory, web)
- <https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-8383166> (web)
- <https://github.com/matthewmueller/dom-iterator/commit/9e0e0fad5a251de5b42feb326c4204eb04080805> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-21541> (advisory)
- <https://github.com/matthewmueller/dom-iterator> (package)

## Sources

- CVE List: [CVE-2024-21541](https://www.cve.org/CVERecord?id=CVE-2024-21541), CVE Terms of Use, modified 2025-01-16
- GitHub Advisory Database: [GHSA-jrvm-mcxc-mf6m](https://github.com/advisories/GHSA-jrvm-mcxc-mf6m), CC-BY-4.0, modified 2025-01-14
- NVD: [CVE-2024-21541](https://nvd.nist.gov/vuln/detail/CVE-2024-21541), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-21541 · Whole record: https://cve.day/CVE-2024-21541.json · Rebuilt by cve.day 2026-11-25T22:58:48.187Z
