CVE-2026-88060: Angular: SSR XSS via Unescaped <template> Content Across DocumentFragment Boundaries in Fallback Raw-Content Elements
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…
Published Sep 10, 2026
Affected packages
@angular/platform-server
- Ecosystem
- npm
- Affected
- >= 22.0.0, < 22.1.4
- Fixed in
- 22.1.4
- Check
npm ls @angular/platform-server
@angular/platform-server
- Ecosystem
- npm
- Affected
- >= 21.0.0, < 21.2.22
- Fixed in
- 21.2.22
- Check
npm ls @angular/platform-server
@angular/platform-server
- Ecosystem
- npm
- Affected
- >= 20.0.0, < 20.3.30
- Fixed in
- 20.3.30
- Check
npm ls @angular/platform-server
@angular/platform-server
- Ecosystem
- npm
- Affected
- <= 19.2.25
- Fixed in
- No patched version yet
- Check
npm ls @angular/platform-server
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
An XSS vulnerability exists in @angular/platform-server during server-side rendering (SSR) HTML serialization when traversing ancestor tags across <template> element boundaries. When an application renders untrusted user input within raw-text tags (<xmp>, <style>, <script>), comments, or text nodes inside a <template> that is nested within a fallback raw-content element (<noscript>, <iframe>, <noembed>, <noframes>), matching closing tags (e.g., </noscript>) 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 (<noscript>, <iframe>, <noembed>, <noframes>) 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., </noscript>) 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 -> </tag). However:
- Per DOM specifications, the children of a
<template>element reside in a separateDocumentFragment(template.content), whose ownparentNodeisnull. - The serializer's ancestor traversal previously only inspected element nodes. When traversing upward from a node inside
template.content, traversal terminated immediately at theDocumentFragmentboundary. - Because traversal stopped before reaching the outer document tree, enclosing fallback raw-content ancestors (such as
<noscript>or<iframe>) were not discovered. As a result, closing sequences like</noscript>within<template>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
<xmp>or<style>directly inside a component's<template>markup requires relaxed template schema checks (CUSTOM_ELEMENTS_SCHEMAorNO_ERRORS_SCHEMA). However, standard HTML comments and text nodes inside<template>within<noscript>are reachable without relaxed schemas. - Imperative DOM Construction: Components or directives that construct DOM structures imperatively via
Renderer2bypass template compiler schema checks entirely and are unconditionally affected.
Proof of Concept (Minimal Reproduction)
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
standalone: true,
template: `
<noscript>
<template>
<xmp>{{ payload }}</xmp>
</template>
</noscript>
`
})
export class AppComponent {
// Attacker-controlled input bound via standard text interpolation
payload = '</noscript>';
}Vulnerable SSR Output:
<noscript><template><xmp></noscript></xmp></template></noscript>Workarounds
- Avoid rendering untrusted user input inside
<template>elements nested within<noscript>,<iframe>,<noembed>, or<noframes>in server-rendered templates. - Avoid programmatic DOM assembly of
<template>elements inside fallback containers when handling untrusted data.
Credited to mabjr33, alan-agius4.
References
- https://github.com/angular/angular/security/advisories/GHSA-v3p8-whq6-r5jg
- https://github.com/angular/angular/commit/73d8bbd27cb46495426d4132975a1355b47ad915
- https://github.com/angular/angular/commit/89b20568dfaee1ec8e0b3bcf1872acdddd2f4fef
- https://github.com/angular/angular/commit/ba3bc47b20b3d12f5eb141ec9c651373ae4d15e8
- https://github.com/angular/domino/commit/04f987dc08ff3736b427f50941adf1722458528f
- https://github.com/angular/angular/releases/tag/v20.3.30
- https://github.com/angular/angular/releases/tag/v21.2.22
- https://github.com/angular/angular/releases/tag/v22.1.4
- https://github.com/advisories/GHSA-v3p8-whq6-r5jg
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-111754
@angular/platform-server: Open Redirect via Protocol-Relative URLs in Server-Side Rendering (SSR)
medium5.1No fixOct 20, 2026CVE-2026-101895
Angular SSR: Denial of Service (DoS) via Infinite Loop on Malformed DOCTYPE
high8.7No fixSep 28, 2026CVE-2026-88058
Angular SSR: XSS via Unescaped Processing Instruction (<?...?>) Nodes in Fallback Raw-Content Elements
high8.6No fixSep 28, 2026CVE-2026-88056
Angular: SSRF and Cross-Origin Credential Disclosure via URL Resolution Discrepancy in SSR
high8.6No fixSep 10, 2026CVE-2026-69149
Angular SSR: Missing Fallback Raw-Content Serialization Escaping leads to Cross-Site Scripting (XSS)
high8.6No fixAug 3, 2026CVE-2026-50168
@angular/platform-server: URL Parser Differential leading to SSRF Allowlist Bypass
high8.2No fixJun 15, 2026
