Summary
A Cross-Site Scripting (XSS) vulnerability has been identified in the Angular Template Compiler. The vulnerability exists because Angular’s internal sanitization schema fails to recognize the href and xlink:href attributes of SVG <script> elements as a Resource URL context.
In a standard security model, attributes that can load and execute code (like a script's source) should be strictly validated. However, because the compiler does not classify these specific SVG attributes correctly, it allows attackers to bypass Angular's built-in security protections.
When template binding is used to assign user-controlled data to these attributes for example, <script [attr.href]="userInput"> the compiler treats the value as a standard string or a non-sensitive URL rather than a resource link. This enables an attacker to provide a malicious payload, such as a data:text/javascript URI or a link to an external malicious script.
Attack Preconditions
- The victim application must explicitly use SVG
<script>elements within its templates. - The application must use property or attribute binding (interpolation) for the
hreforxlink:hrefattributes of those SVG scripts. - The data bound to these attributes must be derived from an untrusted source (e.g., URL parameters, user-submitted database entries, or unsanitized API responses).
Workarounds
Until the patch is applied, developers should:
- Avoid Dynamic Bindings: Do not use Angular template binding (e.g.,
[attr.href]) for SVG<script>elements. - Input Validation: If dynamic values must be used, strictly validate the input against a strict allowlist of trusted URLs on the server side or before it reaches the template.
Resources
Impact
When successfully exploited, this vulnerability allows for arbitrary JavaScript execution within the context of the victim's browser session. This can lead to:
- Session Hijacking: Stealing session cookies, localStorage data, or authentication tokens.
- Data Exfiltration: Accessing and transmitting sensitive information displayed within the application.
- Unauthorized Actions: Performing state-changing actions (like clicking buttons or submitting forms) on behalf of the authenticated 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
- 19.2.18
- 20.3.16
- 21.0.7
- 21.1.0-rc.0
Frequently Asked Questions
- What is CVE-2026-22610? CVE-2026-22610 is a high-severity cross-site scripting (XSS) vulnerability in @angular/compiler (npm), affecting versions >= 21.1.0-next.0, < 21.1.0-rc.0. It is fixed in 21.1.0-rc.0, 21.0.7, 20.3.16, 19.2.18. 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-22610?
@angular/compiler(npm) (versions >= 21.1.0-next.0, < 21.1.0-rc.0)@angular/core(npm) (versions >= 21.1.0-next.0, < 21.1.0-rc.0)
- Is there a fix for CVE-2026-22610? Yes. CVE-2026-22610 is fixed in 21.1.0-rc.0, 21.0.7, 20.3.16, 19.2.18. Upgrade to this version or later.
- Is CVE-2026-22610 exploitable, and should I be worried? Whether CVE-2026-22610 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-22610 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-22610?
- Upgrade
@angular/compilerto 21.1.0-rc.0 or later - Upgrade
@angular/coreto 21.1.0-rc.0 or later - Upgrade
@angular/compilerto 21.0.7 or later - Upgrade
@angular/coreto 21.0.7 or later - Upgrade
@angular/compilerto 20.3.16 or later - Upgrade
@angular/coreto 20.3.16 or later - Upgrade
@angular/compilerto 19.2.18 or later - Upgrade
@angular/coreto 19.2.18 or later
- Upgrade