CVE-2026-50557: Angular Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-f3m7-gqxr-g87x
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2026-50557 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 libraries in the npm ecosystem. The issue involves template and attribute namespace sanitization bypass (xss). Remediation is available by upgrading affected packages to version 21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.22.

CVE-2026-50557 at a Glance

CVE Identifier CVE-2026-50557
GHSA Identifier GHSA-f3m7-gqxr-g87x
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
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-50557

To remediate this vulnerability, upgrade all affected Angular 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: 20.3.22
npm install @angular/core@20.3.22
@angular/core fixed: 19.2.22
npm install @angular/core@19.2.22
@angular/core fixed: Latest secure release
npm install @angular/core@Latest secure release
@angular/compiler fixed: 21.2.15
npm install @angular/compiler@21.2.15
@angular/compiler fixed: 22.0.0-rc.2
npm install @angular/compiler@22.0.0-rc.2
@angular/compiler fixed: 20.3.22
npm install @angular/compiler@20.3.22
@angular/compiler fixed: 19.2.22
npm install @angular/compiler@19.2.22
@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/core

How to Check if You Are Affected

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

npm ls @angular/core

Analyze the terminal output to locate any version of Angular 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, 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` and `@angular/core` packages allows bypassing element and attribute sanitization/validation through specific namespace workarounds. Specifically, namespaced script elements (e.g., `<svg:script>` or `<:svg:script>`) were not properly identified as script elements by the Angular template preparser, allowing them to pass through template compilation without being stripped. Furthermore, security context schema mappings for element attributes did not consistently handle attributes within namespaced elements (like SVG and MathML), opening up gaps where malicious namespaced attributes could bypass runtime and compile-time sanitizers. Combined, these flaws enable an attacker who can inject or supply a template/tag structure with custom namespaces to bypass Angular's script-stripping logic and attribute sanitizers, leading to client-side Cross-Site Scripting (XSS). ### Impact Any Angular application that compiles user-controlled templates at runtime, or relies on sanitization of namespaced elements/attributes, is vulnerable to this security bypass. Once exploited, this allows a malicious actor to inject a namespaced script element or dynamic attribute bindings, bypassing core sanitization constraints 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 Template Input:** The application must accept user-controlled inputs that are directly processed by the Angular template compiler at runtime. 2. **Namespace Parsing Support:** The input structure must employ custom namespace prefixes (such as `<svg:script>`) to evade standard tag-name blocklists/checks. 3. **Absence of Additional Context Sanitization:** The application does not perform separate input sanitization before feeding values to the Angular compiler. ### Patches * 22.0.0-rc.2 * 21.2.15 * 20.3.22 * 19.2.23

CVE-2026-50557 Affected Angular Versions

10 component(s)
Fixed Versions:
21.2.1522.0.0-rc.220.3.2219.2.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
≥ 20.0.0-next.0
< 20.3.22
20.3.22
@angular/core
npm
≥ 19.0.0-next.0
< 19.2.22
19.2.22
@angular/core
npm
≤ 18.2.14
@angular/compiler
npm
≥ 21.0.0-next.0
< 21.2.15
21.2.15
@angular/compiler
npm
≥ 22.0.0-next.0
< 22.0.0-rc.2
22.0.0-rc.2
@angular/compiler
npm
≥ 20.0.0-next.0
< 20.3.22
20.3.22
@angular/compiler
npm
≥ 19.0.0-next.0
< 19.2.22
19.2.22
@angular/compiler
npm
≤ 18.2.14

References

Frequently Asked Questions

What is CVE-2026-50557?
CVE-2026-50557 is a security vulnerability in Angular involving Template and Attribute Namespace Sanitization Bypass (XSS) under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Angular versions are affected?
Affected versions include releases prior to 21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.22 across affected packages: @angular/core, @angular/compiler.
What version fixes CVE-2026-50557?
Upgrading to 21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.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, 20.3.22, 19.2.22, Latest secure release. Upgrade your dependency to 21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.22, Latest secure release or later.
Is @angular/compiler affected?
Yes, @angular/compiler is affected in releases prior to 21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.22, Latest secure release. Upgrade your dependency to 21.2.15, 22.0.0-rc.2, 20.3.22, 19.2.22, Latest secure release or later.
What is the CVSS score of CVE-2026-50557?
CVE-2026-50557 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-50557?
CVE-2026-50557 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-50557?
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-f3m7-gqxr-g87x",
  "modified" : "2026-07-15T22:03:38Z",
  "published" : "2026-06-15T17:21:58Z",
  "aliases" : [ "CVE-2026-50557" ],
  "summary" : "Angular: Template and Attribute Namespace Sanitization Bypass (XSS)",
  "details" : "An issue in the `@angular/compiler` and `@angular/core` packages allows bypassing element and attribute sanitization/validation through specific namespace workarounds.\n\nSpecifically, namespaced script elements (e.g., `<svg:script>` or `<:svg:script>`) were not properly identified as script elements by the Angular template preparser, allowing them to pass through template compilation without being stripped.\n\nFurthermore, security context schema mappings for element attributes did not consistently handle attributes within namespaced elements (like SVG and MathML), opening up gaps where malicious namespaced attributes could bypass runtime and compile-time sanitizers.\n\nCombined, these flaws enable an attacker who can inject or supply a template/tag structure with custom namespaces to bypass Angular's script-stripping logic and attribute sanitizers, leading to client-side Cross-Site Scripting (XSS).\n\n### Impact\nAny Angular application that compiles user-controlled templates at runtime, or relies on sanitization of namespaced elements/attributes, is vulnerable to this security bypass.\n\nOnce exploited, this allows a malicious actor to inject a namespaced script element or dynamic attribute bindings, bypassing core sanitization constraints 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 Template Input:** The application must accept user-controlled inputs that are directly processed by the Angular template compiler at runtime.\n2. **Namespace Parsing Support:** The input structure must employ custom namespace prefixes (such as `<svg:script>`) to evade standard tag-name blocklists/checks.\n3. **Absence of Additional Context Sanitization:** The application does not perform separate input sanitization before feeding values to the Angular compiler.\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" : "20.0.0-next.0"
      }, {
        "fixed" : "20.3.22"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "19.0.0-next.0"
      }, {
        "fixed" : "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/compiler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "21.0.0-next.0"
      }, {
        "fixed" : "21.2.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/compiler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "22.0.0-next.0"
      }, {
        "fixed" : "22.0.0-rc.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/compiler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "20.0.0-next.0"
      }, {
        "fixed" : "20.3.22"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/compiler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "19.0.0-next.0"
      }, {
        "fixed" : "19.2.22"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/compiler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "18.2.14"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/security/advisories/GHSA-f3m7-gqxr-g87x"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-50557"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/pull/68689"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/pull/68868"
  }, {
    "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:21:58Z",
    "nvd_published_at" : "2026-06-22T16:16:38Z"
  }
}