CVE-2026-52725: @angular/core Dynamic Component Namespace Bypass Leading to XSS

@angular/core Updated 15 Jun 2026

Summary

15/06/2026
Yes i
Moderate
5.3

CVE-2026-52725: An issue in the @angular/core package allows bypassing script-execution restrictions during dynamic component creation. Affects @angular/core across 5 version ranges.

< 18.2.14 >= 19.0.0-next.0, < 19.2.23 >= 20.0.0-next.0, < 20.3.22 >= 21.0.0-next.0, < 21.2.15 >= 22.0.0-next.0, < 22.0.0-rc.2

Fixed in 5 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The @angular/core package is a fundamental part of the Angular framework, which is widely used for building web applications. It provides essential functionalities such as component creation, dependency injection, and change detection. This package is known for its robust architecture and ability to create dynamic components. However, it is vulnerable to a specific issue that allows attackers to bypass security measures during dynamic component instantiation.

Vulnerability Detail

The vulnerability arises from a flaw in the dynamic component instantiation mechanism, specifically in the createComponent function. This function fails to prevent the mounting of components directly onto script elements, such as <script> or namespaced svg:script tags. As a result, an attacker who can control the host element or selector parameter can initialize an Angular component on a script tag, leading to the execution of untrusted code. This could result in client-side Cross-Site Scripting (XSS), allowing attackers to hijack sessions, expose sensitive data, or perform unauthorized actions on behalf of users.

How To Fix

Latest published version: 22.2.3 as of 23 Oct 2026

npm install @angular/core@22.2.3

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 18.2.14 18.2.14
    npm install @angular/core@18.2.14
  • >= 19.0.0-next.0, < 19.2.23 19.2.23
    npm install @angular/core@19.2.23
  • >= 20.0.0-next.0, < 20.3.22 20.3.22
    npm install @angular/core@20.3.22
  • >= 21.0.0-next.0, < 21.2.15 21.2.15
    npm install @angular/core@21.2.15
  • >= 22.0.0-next.0, < 22.0.0-rc.2 22.0.0-rc.2
    npm install @angular/core@22.0.0-rc.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, avoid using user-controlled inputs as selectors or host elements for dynamic component creation. Implement additional input sanitization to ensure that user inputs do not lead to the instantiation of components on script tags.

Conclusion

The CVE-2026-52725 vulnerability in the @angular/core package poses a significant risk for Angular applications that utilize dynamic components. It is crucial to update to the patched versions to mitigate the risk of XSS attacks. Implementing workarounds and using tools like Vulert can help monitor and manage vulnerabilities effectively.

See every vulnerability recorded for @angular/core →

Share this vulnerability

FAQ

CVE-2026-52725 is a vulnerability in the @angular/core package that allows attackers to bypass script-execution restrictions during dynamic component creation, leading to potential XSS attacks.

An attacker can exploit this vulnerability by controlling the host element or selector parameter passed to the createComponent function, allowing them to mount a component on a script tag.

Exploitation of this vulnerability can lead to session hijacking, exposure of sensitive data, and unauthorized actions performed on behalf of users.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. By checking your package-lock.json file, you can determine if your application is affected by this vulnerability.

If you cannot update the package immediately, implement input sanitization to prevent user-controlled inputs from being used as selectors or host elements for dynamic component creation.

Related vulnerabilities

Recent vulnerabilities recorded for @angular/core.

How To Fix

Latest published version: 22.2.3 as of 23 Oct 2026

npm install @angular/core@22.2.3

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 18.2.14 18.2.14
    npm install @angular/core@18.2.14
  • >= 19.0.0-next.0, < 19.2.23 19.2.23
    npm install @angular/core@19.2.23
  • >= 20.0.0-next.0, < 20.3.22 20.3.22
    npm install @angular/core@20.3.22
  • >= 21.0.0-next.0, < 21.2.15 21.2.15
    npm install @angular/core@21.2.15
  • >= 22.0.0-next.0, < 22.0.0-rc.2 22.0.0-rc.2
    npm install @angular/core@22.0.0-rc.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback