CVE-2026-52725: Angular Template and Dynamic Component Namespace Bypass leading to Cross-Site Scripting (XSS)

Published Jun 15, 2026
·
Updated

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

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.

Attack Preconditions To successfully exploit these vulnerabilities, the following environment parameters and application states must all concurrently exist: 1. User-Controlled Host Selection: The application must accept user-controlled inputs that are passed as a selector/host element to createComponent. 2. Absence of Additional Context Sanitization: The application does not perform separate input sanitization before feeding values to the dynamic creation APIs.

Patches 22.0.0-rc.2 21.2.15 20.3.22 19.2.23

Other sources

Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 22.0.0-rc.2, 21.2.15, 20.3.22, and 19.2.23, 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). This vulnerability is fixed in 22.0.0-rc.2, 21.2.15, 20.3.22, and 19.2.23.

MITRE

Affected Software

24 affected componentsFixes available
npm/@angular/core>=20.0.0-next.0<20.3.22
20.3.22
npm/@angular/core<=18.2.14
npm/@angular/core>=19.0.0-next.0<19.2.22
19.2.23
npm/@angular/core>=22.0.0-next.0<22.0.0-rc.2
22.0.0-rc.2
npm/@angular/core>=21.0.0-next.0<21.2.15
21.2.15
angular Angular Node.js<=18.2.14
angular Angular Node.js>=19.0.0<19.2.23
angular Angular Node.js>=20.0.0<20.3.22
angular Angular Node.js>=21.0.0<21.2.15
angular Angular Node.js=22.0.0-next0
angular Angular Node.js=22.0.0-next1
angular Angular Node.js=22.0.0-next10
angular Angular Node.js=22.0.0-next11
angular Angular Node.js=22.0.0-next12
angular Angular Node.js=22.0.0-next2
angular Angular Node.js=22.0.0-next3
angular Angular Node.js=22.0.0-next4
angular Angular Node.js=22.0.0-next5
angular Angular Node.js=22.0.0-next6
angular Angular Node.js=22.0.0-next7
angular Angular Node.js=22.0.0-next8
angular Angular Node.js=22.0.0-next9
angular Angular Node.js=22.0.0-rc0
angular Angular Node.js=22.0.0-rc1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@angular/core to a version that resolves this vulnerability.

    Fixed in 20.3.22
  2. Upgrade

    Upgrade npm/@angular/core to a version that resolves this vulnerability.

    Fixed in 19.2.23
  3. Upgrade

    Upgrade npm/@angular/core to a version that resolves this vulnerability.

    Fixed in 22.0.0-rc.2
  4. Upgrade

    Upgrade npm/@angular/core to a version that resolves this vulnerability.

    Fixed in 21.2.15
  5. Upgrade

    Upgrade @angular/core to a version that resolves this vulnerability.

    Fixed in 19.2.23
  6. Upgrade

    Upgrade @angular/core to a version that resolves this vulnerability.

    Fixed in 20.3.22
  7. Upgrade

    Upgrade @angular/core to a version that resolves this vulnerability.

    Fixed in 21.2.15
  8. Upgrade

    Upgrade @angular/core to a version that resolves this vulnerability.

    Fixed in 22.0.0-rc.2

Event History

Jun 15, 2026
Advisory Published
via GitHub·04:51 PM
Data Sourced
via GitHub·04:51 PM
DescriptionWeaknessAffected Software
Jun 22, 2026
CVE Published
via MITRE·03:18 PM
Data Sourced
via MITRE·03:18 PM
DescriptionWeakness
Data Sourced
via NVD·04:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-52725?

CVE-2026-52725 has a risk score of 55, indicating a moderate severity level.

2

How does CVE-2026-52725 affect Angular applications?

CVE-2026-52725 allows attackers to bypass script-execution restrictions, potentially leading to XSS vulnerabilities during dynamic component creation.

3

How do I fix CVE-2026-52725?

To fix CVE-2026-52725, update the `@angular/core` package to the latest version where the vulnerability has been addressed.

4

What components are vulnerable in CVE-2026-52725?

The vulnerability impacts the `createComponent` method in the `@angular/core` package, allowing improper component instantiation.

5

What are the potential impacts of CVE-2026-52725?

The potential impacts of CVE-2026-52725 include unauthorized script execution and exploitation of cross-site scripting (XSS) vulnerabilities.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203