GitHub Advisoryadvisory · npm
GHSA-v3p8-whq6-r5jg Angular: SSR XSS via Unescaped <template> Content Across DocumentFragment Boundaries in Fallback Raw-Content Elements
HIGH
Official page ↗
- Aliases
- CVE-2026-88060
- Ecosystem
- npm
- Packages
- @angular/platform-server
- Severity
- High
- CVSS vector
- 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
- Weaknesses
- CWE-116, CWE-79
- Reviewed
- 2026-09-10
Affected packages
• npm @angular/platform-server: >= 22.0.0, < 22.1.4 → fixed in 22.1.4
• npm @angular/platform-server: >= 21.0.0, < 21.2.22 → fixed in 21.2.22
• npm @angular/platform-server: >= 20.0.0, < 20.3.30 → fixed in 20.3.30
• npm @angular/platform-server: <= 19.2.25 (no fix yet)
Description
Summary
An XSS vulnerability exists in `@angular/platform-server` during server-side rendering (SSR) HTML serialization when traversing ancestor tags across `` element boundaries. When an application renders untrusted user input within raw-text tags (``, ``, ``), comments, or text nodes inside a `` that is nested within a fallback raw-content element (``, ``, ``, ``), matching closing tags (e.g., ``) are not escaped during HTML serialization. When rendered in a browser, this unescaped closing tag prematurely terminates the fallback container and executes trailing markup as active DOM elements.
Technical Description
In HTML5 parsing, fallback raw-content elements (``, ``, ``, ``) place the browser's tokenizer into `RAWTEXT` mode. In this mode, inner content is parsed as literal text until an end tag matching the container tag name (e.g., ``) is encountered.
To prevent XSS breakout vectors during SSR serialization, the DOM serializer inspects a node's ancestors to escape any matching fallback closing tags (` `</tag`). However:
1. Per DOM specifications, the children of a `` element reside in a separate `DocumentFragment` (`template.content`), whose own `parentNode` is `null`.
2. The serializer's ancestor traversal previously only inspected element nodes. When traversing upward from a node inside `template.content`, traversal terminated immediately at the `DocumentFragment` boundary.
3. Because traversal stopped before reaching the outer document tree, enclosing fallback raw-content ancestors (such as `` or ``) were not discovered. As a result, closing sequences like `` within `` content were emitted unescaped.
Impact & Reachability
• Framework Guarantee Bypass: Angular guarantees that standard text interpolation (`{{ userInput }}` bound as element text content) is safe by default without manual sanitization. This vulnerability bypasses that guarantee during SSR HTML serialization when untrusted input is interpolated inside template content within fallback containers.
• Template Authoring: Writing literal `` or `` directly inside a component's `` markup requires relaxed template schema checks (`CUSTOM_ELEMENTS_SCHEMA` or `NO_ERRORS_SCHEMA`). However, standard HTML comments and text nodes inside `` within `` are reachable without relaxed schemas.
• Imperative DOM Construction: Components or directives that construct DOM structures imperatively via `Renderer2` bypass template compiler schema checks entirely and are unconditionally affected.
Proof of Concept (Minimal Reproduction)
```ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
standalone: true,
template: `
{{ payload }}
`
})
export class AppComponent {
// Attacker-controlled input bound via standard text interpolation
payload = '';
}
```
Vulnerable SSR Output:
```html
```
Workarounds
• Avoid rendering untrusted user input inside `` elements nested within ``, ``, ``, or `` in server-rendered templates.
• Avoid programmatic DOM assembly of `` elements inside fallback containers when handling untrusted data.
Related
Alias · CVE (1)
- CVE-2026-88060 Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. vulnerability
References
- https://github.com/angular/angular/security/advisories/GHSA-v3p8-whq6-r5jg web
- https://github.com/angular/angular/commit/73d8bbd27cb46495426d4132975a1355b47ad915 web
- https://github.com/angular/angular/commit/89b20568dfaee1ec8e0b3bcf1872acdddd2f4fef web
- https://github.com/angular/angular/commit/ba3bc47b20b3d12f5eb141ec9c651373ae4d15e8 web
- https://github.com/angular/domino/commit/04f987dc08ff3736b427f50941adf1722458528f web
- https://github.com/angular/angular package
- https://github.com/angular/angular/releases/tag/v20.3.30 web
- https://github.com/angular/angular/releases/tag/v21.2.22 web
- https://github.com/angular/angular/releases/tag/v22.1.4 web