Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @angular/core
  4. ›
  5. CVE-2026-50557

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

June 15, 2026

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

References

  • github.com/advisories/GHSA-f3m7-gqxr-g87x
  • github.com/angular/angular/pull/68689
  • github.com/angular/angular/pull/68868
  • github.com/angular/angular/security/advisories/GHSA-f3m7-gqxr-g87x
  • nvd.nist.gov/vuln/detail/CVE-2026-50557

Code Behaviors & Features

Detect and mitigate CVE-2026-50557 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 18.2.14, all versions starting from 19.0.0-next.0 before 19.2.22, all versions starting from 20.0.0-next.0 before 20.3.22, all versions starting from 21.0.0-next.0 before 21.2.15, all versions starting from 22.0.0-next.0 before 22.0.0-rc.2

Fixed versions

  • 19.2.22
  • 20.3.22
  • 21.2.15
  • 22.0.0-rc.2

Solution

Upgrade to versions 19.2.22, 20.3.22, 21.2.15, 22.0.0-rc.2 or above.

Impact 5.4 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

npm/@angular/core/CVE-2026-50557.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 16 Jun 2026 12:19:55 +0000.