CVE-2026-54265: @angular/compiler Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-58w9-8g37-x9v5
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2026-54265 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/compiler libraries in the npm ecosystem. The issue involves two-way property binding sanitization bypass (xss). Remediation is available by upgrading affected packages to version 22.0.1, 21.2.17, 20.3.25.

CVE-2026-54265 at a Glance

CVE Identifier CVE-2026-54265
GHSA Identifier GHSA-58w9-8g37-x9v5
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/compiler
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-54265

To remediate this vulnerability, upgrade all affected @angular/compiler 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/compiler fixed: 22.0.1
npm install @angular/compiler@22.0.1
@angular/compiler fixed: 21.2.17
npm install @angular/compiler@21.2.17
@angular/compiler fixed: 20.3.25
npm install @angular/compiler@20.3.25
@angular/compiler fixed: Latest secure release
npm install @angular/compiler@Latest secure release
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/compiler

How to Check if You Are Affected

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

npm ls @angular/compiler

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

Note: The npm ls @angular/compiler 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/compiler, 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/compiler` package allows bypassing DOM property sanitization through the use of two-way property bindings. Specifically, when a native DOM property that requires sanitization (such as `innerHTML`, `srcdoc`, `src`, `href`, `data`, or `sandbox`) is bound using the two-way binding syntax (e.g., `[(innerHTML)]="value"` or `bindon-innerHTML="value"`), the Angular template compiler failed to apply the appropriate schema-derived sanitizer resolution to the `TwoWayProperty` operation. As a result, native two-way DOM bindings were emitted without the required sanitizer function, whereas equivalent one-way bindings would be properly sanitized. This flaw enables an attacker who can control the value of a two-way bound sensitive property to bypass Angular's built-in sanitization logic, potentially leading to client-side Cross-Site Scripting (XSS). ### Impact Any Angular application that uses two-way data binding (`[()]` or `bindon-`) on security-sensitive native DOM properties (like `innerHTML`, `href` on `<a>`, `src` on `<img>`/`<iframe>`, etc.) is vulnerable to this security bypass. Once exploited, this allows a malicious actor to supply an unsanitized property binding value that bypasses core sanitization constraints. This could lead to the execution of arbitrary JavaScript within the target user's browser context, potentially resulting in session hijacking, sensitive data exposure, or unauthorized actions on behalf of the user. ### Attack Preconditions To successfully exploit this vulnerability, the following environment parameters and application states must concurrently exist: 1. **Two-Way Binding on Sensitive Properties:** The application must bind to a sensitive native DOM property using the two-way binding syntax (e.g., `<div [(innerHTML)]="userContent"></div>`). 2. **User-Controlled Input:** The value bound to this property must be influenceable by user-controlled input. 3. **Absence of Additional Sanitization:** The application does not perform separate manual sanitization (e.g., via `DomSanitizer`) before passing the value to the bound property. ### Patches * 22.0.1 * 21.2.17 * 20.3.25

CVE-2026-54265 Affected @angular/compiler Versions

4 component(s)
Fixed Versions:
22.0.121.2.1720.3.25
Product / Package Ecosystem Affected Versions Fixed Version
@angular/compiler
npm
≥ 22.0.0-next.0
< 22.0.1
22.0.1
@angular/compiler
npm
≥ 21.0.0-next.0
< 21.2.17
21.2.17
@angular/compiler
npm
≥ 20.0.0-next.0
< 20.3.25
20.3.25
@angular/compiler
npm
≤ 19.2.25

References

Frequently Asked Questions

What is CVE-2026-54265?
CVE-2026-54265 is a security vulnerability in @angular/compiler involving Two-Way Property Binding Sanitization Bypass (XSS) under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which @angular/compiler versions are affected?
Affected versions include releases prior to 22.0.1, 21.2.17, 20.3.25 across affected packages: @angular/compiler.
What version fixes CVE-2026-54265?
Upgrading to 22.0.1, 21.2.17, 20.3.25 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @angular/compiler affected?
Yes, @angular/compiler is affected in releases prior to 22.0.1, 21.2.17, 20.3.25, Latest secure release. Upgrade your dependency to 22.0.1, 21.2.17, 20.3.25, Latest secure release or later.
What is the CVSS score of CVE-2026-54265?
CVE-2026-54265 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-54265?
CVE-2026-54265 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-54265?
Run the dependency tree command: 'npm ls @angular/compiler'. 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-58w9-8g37-x9v5",
  "modified" : "2026-07-15T22:03:42Z",
  "published" : "2026-06-15T17:22:40Z",
  "aliases" : [ "CVE-2026-54265" ],
  "summary" : "@angular/compiler: Two-Way Property Binding Sanitization Bypass (XSS)",
  "details" : "An issue in the `@angular/compiler` package allows bypassing DOM property sanitization through the use of two-way property bindings.\n\nSpecifically, when a native DOM property that requires sanitization (such as `innerHTML`, `srcdoc`, `src`, `href`, `data`, or `sandbox`) is bound using the two-way binding syntax (e.g., `[(innerHTML)]=\"value\"` or `bindon-innerHTML=\"value\"`), the Angular template compiler failed to apply the appropriate schema-derived sanitizer resolution to the `TwoWayProperty` operation. As a result, native two-way DOM bindings were emitted without the required sanitizer function, whereas equivalent one-way bindings would be properly sanitized.\n\nThis flaw enables an attacker who can control the value of a two-way bound sensitive property to bypass Angular's built-in sanitization logic, potentially leading to client-side Cross-Site Scripting (XSS).\n\n### Impact\nAny Angular application that uses two-way data binding (`[()]` or `bindon-`) on security-sensitive native DOM properties (like `innerHTML`, `href` on `<a>`, `src` on `<img>`/`<iframe>`, etc.) is vulnerable to this security bypass.\n\nOnce exploited, this allows a malicious actor to supply an unsanitized property binding value that bypasses core sanitization constraints. This could lead to the execution of arbitrary JavaScript within the target user's browser context, potentially resulting in session hijacking, sensitive data exposure, or unauthorized actions on behalf of the user.\n\n### Attack Preconditions\nTo successfully exploit this vulnerability, the following environment parameters and application states must concurrently exist:\n1. **Two-Way Binding on Sensitive Properties:** The application must bind to a sensitive native DOM property using the two-way binding syntax (e.g., `<div [(innerHTML)]=\"userContent\"></div>`).\n2. **User-Controlled Input:** The value bound to this property must be influenceable by user-controlled input.\n3. **Absence of Additional Sanitization:** The application does not perform separate manual sanitization (e.g., via `DomSanitizer`) before passing the value to the bound property.\n\n### Patches\n* 22.0.1\n* 21.2.17\n* 20.3.25",
  "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/compiler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "22.0.0-next.0"
      }, {
        "fixed" : "22.0.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/compiler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "21.0.0-next.0"
      }, {
        "fixed" : "21.2.17"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/compiler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "20.0.0-next.0"
      }, {
        "fixed" : "20.3.25"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/compiler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "19.2.25"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/security/advisories/GHSA-58w9-8g37-x9v5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-54265"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/pull/69107"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/commit/3c70270c96677c0dd33585f2afe8e187113e5fb4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/angular/angular"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-15T17:22:40Z",
    "nvd_published_at" : "2026-06-22T16:16:39Z"
  }
}