What’s Vulnerable › Vulnerabilities
CVE-2021-22540: XSS in Dart SDK
- Severity: medium (CVSS 6.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.7% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2021-04-22 · updated 2026-06-17
- Weakness: CWE-79
Description
Bad validation logic in the Dart SDK versions prior to 2.12.3 allow an attacker to use an XSS attack via DOM clobbering. The validation logic in dart:html for creating DOM nodes from text did not sanitize properly when it came across template tags.
Affected products
- Google LLC Dart SDK: before 2.12.3 — fixed in 2.12.3
How to fix
Upgrade to a fixed version: Google LLC Dart SDK 2.12.3. Check the vendor advisory for mitigations.
References
- https://github.com/dart-lang/sdk/commit/ce5a1c2392debce967415d4c09359ff2555e3588
- https://github.com/dart-lang/sdk/security/advisories/GHSA-3rfv-4jvg-9522
- https://github.com/dart-lang/sdk/commit/ce5a1c2392debce967415d4c09359ff2555e3588
- https://github.com/dart-lang/sdk/security/advisories/GHSA-3rfv-4jvg-9522
Get alerted when CVE-2021-22540 or the next vulnerability affects your stack