Summary
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).
Attack Preconditions
To successfully exploit these vulnerabilities, the following environment parameters and application states must all concurrently exist:
- User-Controlled Template Input: The application must accept user-controlled inputs that are directly processed by the Angular template compiler at runtime.
- Namespace Parsing Support: The input structure must employ custom namespace prefixes (such as
<svg:script>) to evade standard tag-name blocklists/checks. - Absence of Additional Context Sanitization: The application does not perform separate input sanitization before feeding values to the Angular compiler.
Impact
Any Angular application that compiles user-controlled templates at runtime, or relies on sanitization of namespaced elements/attributes, is vulnerable to this security bypass.
Once exploited, this allows a malicious actor to inject a namespaced script element or dynamic attribute bindings, bypassing core sanitization constraints to execute arbitrary JavaScript within the target user's browser context. This could lead to session hijacking, sensitive data exposure, or unauthorized actions on behalf of the user.
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
- 22.0.0-rc.2
- 21.2.15
- 20.3.22
- 19.2.23
Frequently Asked Questions
- What is CVE-2026-50557? CVE-2026-50557 is a medium-severity cross-site scripting (XSS) vulnerability in @angular/core (npm), affecting versions >= 21.0.0-next.0, < 21.2.15. It is fixed in 21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.22. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- Which packages are affected by CVE-2026-50557?
@angular/core(npm) (versions >= 21.0.0-next.0, < 21.2.15)@angular/compiler(npm) (versions >= 21.0.0-next.0, < 21.2.15)
- Is there a fix for CVE-2026-50557? Yes. CVE-2026-50557 is fixed in 21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.22. Upgrade to this version or later.
- Is CVE-2026-50557 exploitable, and should I be worried? Whether CVE-2026-50557 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-50557 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-50557?
- Upgrade
@angular/coreto 21.2.15 or later - Upgrade
@angular/coreto 22.0.0-rc.2 or later - Upgrade
@angular/coreto 20.3.22 or later - Upgrade
@angular/coreto 19.2.22 or later - Upgrade
@angular/compilerto 21.2.15 or later - Upgrade
@angular/compilerto 22.0.0-rc.2 or later - Upgrade
@angular/compilerto 20.3.22 or later - Upgrade
@angular/compilerto 19.2.22 or later
- Upgrade