CVE-2026-88058: Angular SSR Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-j3r3-mxqp-r2p4
CWE-116 CWE-79
Published
Advisory Summary

CVE-2026-88058 is a HIGH cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Angular SSR libraries in the npm ecosystem. The issue involves xss via unescaped processing instruction (<?...?>) nodes in fallback raw-content elements. Remediation is available by upgrading affected packages to version 22.1.4, 21.2.22, 20.3.30.

CVE-2026-88058 at a Glance

CVE Identifier CVE-2026-88058
GHSA Identifier GHSA-j3r3-mxqp-r2p4
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Angular SSR
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-88058

To remediate this vulnerability, upgrade all affected Angular SSR 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/platform-server fixed: 22.1.4
npm install @angular/platform-server@22.1.4
@angular/platform-server fixed: 21.2.22
npm install @angular/platform-server@21.2.22
@angular/platform-server fixed: 20.3.30
npm install @angular/platform-server@20.3.30
@angular/platform-server fixed: Latest secure release
npm install @angular/platform-server@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/platform-server

How to Check if You Are Affected

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

npm ls @angular/platform-server

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

Note: The npm ls @angular/platform-server 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-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Angular SSR, 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

### Summary An XSS vulnerability exists in `@angular/platform-server` during server-side rendering (SSR) HTML serialization of `ProcessingInstruction` DOM nodes (`<?target data?>`, `nodeType === 7`) when nested inside fallback raw-content elements (`<noscript>`, `<iframe>`, `<noembed>`, `<noframes>`). While processing instruction data escaped `>` to `&gt;`, it did not check for or escape matching closing tags of ancestor fallback elements (e.g., `</noscript>`). When rendered in a browser with scripting enabled, an unescaped closing tag sequence in a processing instruction prematurely closes the fallback raw-content tag and causes subsequent sibling elements to execute as live HTML. ### Technical Description In HTML5 parsing, fallback raw-content elements (`<noscript>`, `<iframe>`, `<noembed>`, `<noframes>`) place the browser's HTML tokenizer into `RAWTEXT` mode. In `RAWTEXT` mode, processing instruction tokens (`<?...?>`) are treated as literal raw text rather than bogus comments, and the parser ignores `>` or `?>`. The only token sequence that terminates the container is an end tag matching the container tag name (`</noscript`, `</iframe`, etc.). During server-side HTML serialization, processing instruction nodes previously only replaced `>` with `&gt;` (preventing bogus comment breakouts in normal HTML data states) but left `<` untouched. Crucially, processing instruction serialization never inspected ancestor fallback raw-content tags. As a result, if a `ProcessingInstruction` node inside `<noscript>` contained `</noscript ` in its data payload, it was emitted unescaped as `<?x </noscript ?>`. ### Impact & Reachability * **Reachability**: Processing instruction nodes cannot be authored directly through standard Angular template syntax (which parses `<?...>` into comment nodes in DOM position). Reaching this vulnerability requires application or library code calling `inject(DOCUMENT).createProcessingInstruction(target, data)` or `Renderer2` DOM insertion methods with untrusted user input passed to `data` inside a fallback raw-content container. * **Impact**: In applications that programmatically construct processing instruction nodes inside fallback elements during server-side rendering, an attacker controlling the processing instruction data can break out of the container and execute arbitrary JavaScript in victims' browsers. ### Proof of Concept (Minimal Reproduction) ```ts import { Component, ElementRef, Renderer2, inject, DOCUMENT, AfterViewInit } from '@angular/core'; @Component({ selector: 'app-root', standalone: true, template: `<noscript id="host"></noscript>` }) export class AppComponent implements AfterViewInit { private r = inject(Renderer2); private el = inject(ElementRef); private doc = inject(DOCUMENT); ngAfterViewInit() { const host = this.el.nativeElement.querySelector('#host'); // Attacker-controlled input passed as Processing Instruction data const pi = this.doc.createProcessingInstruction('x', '</noscript '); this.r.appendChild(host, pi); // Sibling markup that should remain inert inside <noscript> const img = this.r.createElement('img'); this.r.setAttribute(img, 'src', 'x'); this.r.setAttribute(img, 'onerror', 'alert("SSR_PI_XSS")'); this.r.appendChild(host, img); } } ``` **Vulnerable SSR Output**: ```html <noscript><?x </noscript ?><img src="x" onerror="alert('SSR_PI_XSS')"></noscript> ``` ### Workarounds * Avoid passing untrusted user input into `document.createProcessingInstruction(target, data)` when the node is inserted into `<noscript>`, `<iframe>`, `<noembed>`, or `<noframes>` during server-side rendering. * Manually sanitize or replace `<` with `&lt;` in any untrusted data passed to processing instruction nodes on the server.

CVE-2026-88058 Affected Angular SSR Versions

4 component(s)
Fixed Versions:
22.1.421.2.2220.3.30
Product / Package Ecosystem Affected Versions Fixed Version
@angular/platform-server
npm
≥ 22.0.0
< 22.1.4
22.1.4
@angular/platform-server
npm
≥ 21.0.0
< 21.2.22
21.2.22
@angular/platform-server
npm
≥ 20.0.0
< 20.3.30
20.3.30
@angular/platform-server
npm
≤ 19.2.25

References

Frequently Asked Questions

What is CVE-2026-88058?
CVE-2026-88058 is a security vulnerability in Angular SSR involving XSS via Unescaped Processing Instruction (<?...?>) Nodes in Fallback Raw-Content Elements under CWE-116: Improper Encoding or Escaping of Output.
Which Angular SSR versions are affected?
Affected versions include releases prior to 22.1.4, 21.2.22, 20.3.30 across affected packages: @angular/platform-server.
What version fixes CVE-2026-88058?
Upgrading to 22.1.4, 21.2.22, 20.3.30 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @angular/platform-server affected?
Yes, @angular/platform-server is affected in releases prior to 22.1.4, 21.2.22, 20.3.30, Latest secure release. Upgrade your dependency to 22.1.4, 21.2.22, 20.3.30, Latest secure release or later.
What CWE is associated with CVE-2026-88058?
CVE-2026-88058 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check npm dependencies for CVE-2026-88058?
Run the dependency tree command: 'npm ls @angular/platform-server'. 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-j3r3-mxqp-r2p4",
  "modified" : "2026-09-28T20:39:26Z",
  "published" : "2026-09-28T20:39:26Z",
  "aliases" : [ "CVE-2026-88058" ],
  "summary" : "Angular SSR: XSS via Unescaped Processing Instruction (<?...?>) Nodes in Fallback Raw-Content Elements",
  "details" : "### Summary\nAn XSS vulnerability exists in `@angular/platform-server` during server-side rendering (SSR) HTML serialization of `ProcessingInstruction` DOM nodes (`<?target data?>`, `nodeType === 7`) when nested inside fallback raw-content elements (`<noscript>`, `<iframe>`, `<noembed>`, `<noframes>`). While processing instruction data escaped `>` to `&gt;`, it did not check for or escape matching closing tags of ancestor fallback elements (e.g., `</noscript>`). When rendered in a browser with scripting enabled, an unescaped closing tag sequence in a processing instruction prematurely closes the fallback raw-content tag and causes subsequent sibling elements to execute as live HTML.\n\n### Technical Description\nIn HTML5 parsing, fallback raw-content elements (`<noscript>`, `<iframe>`, `<noembed>`, `<noframes>`) place the browser's HTML tokenizer into `RAWTEXT` mode. In `RAWTEXT` mode, processing instruction tokens (`<?...?>`) are treated as literal raw text rather than bogus comments, and the parser ignores `>` or `?>`. The only token sequence that terminates the container is an end tag matching the container tag name (`</noscript`, `</iframe`, etc.).\n\nDuring server-side HTML serialization, processing instruction nodes previously only replaced `>` with `&gt;` (preventing bogus comment breakouts in normal HTML data states) but left `<` untouched. Crucially, processing instruction serialization never inspected ancestor fallback raw-content tags. As a result, if a `ProcessingInstruction` node inside `<noscript>` contained `</noscript ` in its data payload, it was emitted unescaped as `<?x </noscript ?>`.\n\n### Impact & Reachability\n* **Reachability**: Processing instruction nodes cannot be authored directly through standard Angular template syntax (which parses `<?...>` into comment nodes in DOM position). Reaching this vulnerability requires application or library code calling `inject(DOCUMENT).createProcessingInstruction(target, data)` or `Renderer2` DOM insertion methods with untrusted user input passed to `data` inside a fallback raw-content container.\n* **Impact**: In applications that programmatically construct processing instruction nodes inside fallback elements during server-side rendering, an attacker controlling the processing instruction data can break out of the container and execute arbitrary JavaScript in victims' browsers.\n\n### Proof of Concept (Minimal Reproduction)\n```ts\nimport { Component, ElementRef, Renderer2, inject, DOCUMENT, AfterViewInit } from '@angular/core';\n\n@Component({\n  selector: 'app-root',\n  standalone: true,\n  template: `<noscript id=\"host\"></noscript>`\n})\nexport class AppComponent implements AfterViewInit {\n  private r = inject(Renderer2);\n  private el = inject(ElementRef);\n  private doc = inject(DOCUMENT);\n\n  ngAfterViewInit() {\n    const host = this.el.nativeElement.querySelector('#host');\n    \n    // Attacker-controlled input passed as Processing Instruction data\n    const pi = this.doc.createProcessingInstruction('x', '</noscript ');\n    this.r.appendChild(host, pi);\n    \n    // Sibling markup that should remain inert inside <noscript>\n    const img = this.r.createElement('img');\n    this.r.setAttribute(img, 'src', 'x');\n    this.r.setAttribute(img, 'onerror', 'alert(\"SSR_PI_XSS\")');\n    this.r.appendChild(host, img);\n  }\n}\n```\n**Vulnerable SSR Output**:\n```html\n<noscript><?x </noscript ?><img src=\"x\" onerror=\"alert('SSR_PI_XSS')\"></noscript>\n```\n\n### Workarounds\n* Avoid passing untrusted user input into `document.createProcessingInstruction(target, data)` when the node is inserted into `<noscript>`, `<iframe>`, `<noembed>`, or `<noframes>` during server-side rendering.\n* Manually sanitize or replace `<` with `&lt;` in any untrusted data passed to processing instruction nodes on the server.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/platform-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "22.0.0"
      }, {
        "fixed" : "22.1.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/platform-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "21.0.0"
      }, {
        "fixed" : "21.2.22"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/platform-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "20.0.0"
      }, {
        "fixed" : "20.3.30"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/platform-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "19.2.25"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/security/advisories/GHSA-j3r3-mxqp-r2p4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-88058"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/issues/70146"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/commit/73d8bbd27cb46495426d4132975a1355b47ad915"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/commit/89b20568dfaee1ec8e0b3bcf1872acdddd2f4fef"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/commit/ba3bc47b20b3d12f5eb141ec9c651373ae4d15e8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/domino/commit/04f987dc08ff3736b427f50941adf1722458528f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/angular/angular"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/releases/tag/v20.3.30"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/releases/tag/v21.2.22"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/releases/tag/v22.1.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-28T20:39:26Z",
    "nvd_published_at" : "2026-09-10T19:17:41Z"
  }
}