CVE-2026-50557: Google Angular XSS bypass via namespaced elements and attributes

CVE-2026-50557 · Severity: medium · CVSS 3.1 · Published 2026-06-22

Angular is a popular framework used to build web and mobile applications. A security flaw in how it handles certain code tags (like SVG or MathML) could allow an attacker to bypass built-in security filters. If an application processes user-provided content through the Angular compiler, an attacker could execute malicious scripts in a victim's browser, potentially leading to account takeover or the theft of sensitive information.

Technologies: Google Compiler, @angular/compiler (npm), @angular/core (npm). Vendors: Google, npm.

Quick answers

Is CVE-2026-50557 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-50557 being exploited in the wild.
How severe is CVE-2026-50557?
Medium severity, with a CVSS score of 3.1, published 22 June 2026.
Which products and versions are affected?
Google Compiler <= 18.2.14, >= 19.0.0-next.0, < 19.2.22, >= 20.0.0-next.0, < 20.3.22, >= 21.0.0-next.0, < 21.2.15, >= 22.0.0-next.0, < 22.0.0-rc.2; @angular/compiler (npm) SEMVER:introduced=21.0.0-next.0,fixed=21.2.15; @angular/core (npm) SEMVER:introduced=21.0.0-next.0,fixed=21.2.15.
Is there a fix for CVE-2026-50557?
Yes. @angular/compiler (npm): upgrade to 21.2.15 or later; @angular/core (npm): upgrade to 21.2.15 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-50557 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-50557?
Check whether you run Google Compiler, @angular/compiler (npm) or @angular/core (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • @angular/compiler (npm): upgrade to 21.2.15 or later
    npm install @angular/compiler@21.2.15
  • @angular/core (npm): upgrade to 21.2.15 or later
    npm install @angular/core@21.2.15

Technical details

A vulnerability exists in the @angular/compiler and @angular/core packages where the template preparser fails to correctly identify and strip namespaced script elements (e.g., <svg:script>). Additionally, security context schema mappings for attributes within namespaced elements like SVG and MathML were inconsistent, allowing malicious attributes to bypass both runtime and compile-time sanitizers. An attacker can exploit this by providing a crafted template structure using custom namespaces. This bypasses Angular's script-stripping logic and attribute sanitization, resulting in client-side Cross-Site Scripting (XSS). The vulnerability primarily affects applications that compile user-controlled templates at runtime. Patches are available in versions 19.2.22, 20.3.22, 21.2.15, and 22.0.0-rc.2.

Affected products

  • Google Angular < 19.2.22, >= 19.0.0-next.0 < 19.2.22, >= 20.0.0-next.0 < 20.3.22, >= 21.0.0-next.0 < 21.2.15, >= 22.0.0-next.0 < 22.0.0-rc.2

Identifiers

  • CVE-2026-50557
  • GHSA-f3m7-gqxr-g87x

Timeline

  • 2026-05-12: other: Initial pull request for SVG script stripping submitted
  • 2026-06-05: advisory: GitHub Security Advisory GHSA-f3m7-gqxr-g87x published
  • 2026-06-22: disclosed: CVE-2026-50557 published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.