CVE-2026-52725: @angular/core Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-692r-grfm-v8x7
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2026-52725 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @angular/core libraries in the npm ecosystem. The issue involves angular template and dynamic component namespace bypass leading to cross-site scripting (xss). Remediation is available by upgrading affected packages to version 21.2.15, 22.0.0-rc.2, 19.2.23, 20.3.22.

CVE-2026-52725 at a Glance

CVE Identifier CVE-2026-52725
GHSA Identifier GHSA-692r-grfm-v8x7
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product @angular/core
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-52725

To remediate this vulnerability, upgrade all affected @angular/core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@angular/core fixed: 21.2.15
npm install @angular/core@21.2.15
@angular/core fixed: 22.0.0-rc.2
npm install @angular/core@22.0.0-rc.2
@angular/core fixed: 19.2.23
npm install @angular/core@19.2.23
@angular/core fixed: Latest secure release
npm install @angular/core@Latest secure release
@angular/core fixed: 20.3.22
npm install @angular/core@20.3.22
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @angular/core

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-52725, inspect your project dependencies using npm:

npm ls @angular/core

Analyze the terminal output to locate any version of @angular/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 21.2.15), your application is affected.

Note: The npm ls @angular/core command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In @angular/core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-52725 Affected @angular/core Versions

5 component(s)
Fixed Versions:
21.2.1522.0.0-rc.219.2.2320.3.22
Product / Package Ecosystem Affected Versions Fixed Version
@angular/core
npm
≥ 21.0.0-next.0
< 21.2.15
21.2.15
@angular/core
npm
≥ 22.0.0-next.0
< 22.0.0-rc.2
22.0.0-rc.2
@angular/core
npm
≥ 19.0.0-next.0
< 19.2.23
19.2.23
@angular/core
npm
≤ 18.2.14
@angular/core
npm
≥ 20.0.0-next.0
< 20.3.22
20.3.22

References

Frequently Asked Questions

What is CVE-2026-52725?
CVE-2026-52725 is a security vulnerability in @angular/core involving Angular Template and Dynamic Component Namespace Bypass leading to Cross-Site Scripting (XSS) under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which @angular/core versions are affected?
Affected versions include releases prior to 21.2.15, 22.0.0-rc.2, 19.2.23, 20.3.22 across affected packages: @angular/core.
What version fixes CVE-2026-52725?
Upgrading to 21.2.15, 22.0.0-rc.2, 19.2.23, 20.3.22 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @angular/core affected?
Yes, @angular/core is affected in releases prior to 21.2.15, 22.0.0-rc.2, 19.2.23, Latest secure release, 20.3.22. Upgrade your dependency to 21.2.15, 22.0.0-rc.2, 19.2.23, Latest secure release, 20.3.22 or later.
What is the CVSS score of CVE-2026-52725?
CVE-2026-52725 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-52725?
CVE-2026-52725 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2026-52725?
Run the dependency tree command: 'npm ls @angular/core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-692r-grfm-v8x7",
  "modified" : "2026-07-15T22:03:32Z",
  "published" : "2026-06-15T16:51:35Z",
  "aliases" : [ "CVE-2026-52725" ],
  "summary" : "@angular/core: Angular Template and Dynamic Component Namespace Bypass leading to Cross-Site Scripting (XSS)",
  "details" : "An issue in the `@angular/core` package allows bypassing script-execution restrictions during dynamic component creation.\n\nSpecifically, 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.\n\nThis 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).\n\n### Impact\nAny Angular application that registers dynamic components based on user-supplied parameters (like selectors or host elements) is vulnerable to this security bypass.\n\nOnce 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.\n\n### Attack Preconditions\nTo successfully exploit these vulnerabilities, the following environment parameters and application states must all concurrently exist:\n1. **User-Controlled Host Selection:** The application must accept user-controlled inputs that are passed as a selector/host element to `createComponent`.\n2. **Absence of Additional Context Sanitization:** The application does not perform separate input sanitization before feeding values to the dynamic creation APIs.\n\n### Patches\n* 22.0.0-rc.2\n* 21.2.15\n* 20.3.22\n* 19.2.23",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "21.0.0-next.0"
      }, {
        "fixed" : "21.2.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "22.0.0-next.0"
      }, {
        "fixed" : "22.0.0-rc.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "19.0.0-next.0"
      }, {
        "fixed" : "19.2.23"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 19.2.22"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "18.2.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "20.0.0-next.0"
      }, {
        "fixed" : "20.3.22"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/security/advisories/GHSA-692r-grfm-v8x7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-52725"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/pull/68686"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/pull/68713"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/angular/angular"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-15T16:51:35Z",
    "nvd_published_at" : "2026-06-22T16:16:38Z"
  }
}