Summary
An issue in the @angular/core package allows bypassing script-execution restrictions during dynamic component creation.
Specifically, the dynamic component instantiation mechanism (createComponent) failed to reject mounting components directly onto a <script> or namespaced script element (such as <svg:script>). This enabled the initialization of custom components on a tag that executes scripts, allowing attackers to hijack or inject script-executing hosts.
This flaw enables an attacker who can control the host element or selector parameter passed to createComponent to initialize or mount an Angular component directly onto a <script> tag, leading to execution of untrusted code or 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 Host Selection: The application must accept user-controlled inputs that are passed as a selector/host element to
createComponent. - Absence of Additional Context Sanitization: The application does not perform separate input sanitization before feeding values to the dynamic creation APIs.
Impact
Any Angular application that registers dynamic components based on user-supplied parameters (like selectors or host elements) is vulnerable to this security bypass.
Once exploited, this allows a malicious actor to mount a dynamic component on a script tag, bypassing core dynamic component creation safeguards 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-52725? CVE-2026-52725 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, 19.2.23, 20.3.22. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- Which versions of @angular/core are affected by CVE-2026-52725? @angular/core (npm) versions >= 21.0.0-next.0, < 21.2.15 is affected.
- Is there a fix for CVE-2026-52725? Yes. CVE-2026-52725 is fixed in 21.2.15, 22.0.0-rc.2, 19.2.23, 20.3.22. Upgrade to this version or later.
- Is CVE-2026-52725 exploitable, and should I be worried? Whether CVE-2026-52725 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-52725 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-52725?
- Upgrade
@angular/coreto 21.2.15 or later - Upgrade
@angular/coreto 22.0.0-rc.2 or later - Upgrade
@angular/coreto 19.2.23 or later - Upgrade
@angular/coreto 20.3.22 or later
- Upgrade