CVE-2024-21541
dom-iterator code execution vulnerability
Severity by source
Trivy's own label is CRITICAL. Rated critical by NVD. Rated lower by GHSA (medium).
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.
Affected packages and fixed versions
| Source | Package | Fixed in |
|---|---|---|
| npm::GitHub Security Advisory npm | dom-iterator | 1.0.1 |
References
- https://github.com/matthewmueller/dom-iterator
- https://github.com/matthewmueller/dom-iterator/commit/9e0e0fad5a251de5b42feb326c4204eb04080805
- https://nvd.nist.gov/vuln/detail/CVE-2024-21541
- https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-8383166
- https://security.snyk.io/vuln/SNYK-JS-DOMITERATOR-6157199