Angularに不適切なエンコード・エスケープの脆弱性(CVE-2026-88060)
概要
Angularに不適切なエンコード・エスケープ・クロスサイトスクリプティング(XSS)の脆弱性が確認されました。
バージョン 22.0.0 以上 22.1.4 未満、21.0.0 以上 21.2.22 未満、20.0.0 以上 20.3.30 未満、19.2.25 以前に影響があります。
修正版 22.1.4 / 21.2.22 / 20.3.30 への更新が推奨されます。
脆弱性の基本情報
| 脆弱性ID |
CVE-2026-88060 GHSA-v3p8-whq6-r5jg |
|---|---|
| 脆弱性の種類 | 不適切なエンコード・エスケープ クロスサイトスクリプティング(XSS) |
| 危険度 | 中 |
| CVSSスコア |
6.1(CVSS v3.1) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| 公開日 | 2026年9月10日 |
| 更新日 | 2026年9月29日 |
影響を受ける製品
| 製品 | 影響を受けるバージョン | 修正版 | 出典 |
|---|---|---|---|
| Angular |
22.0.0 以上 22.1.4 未満、21.0.0 以上 21.2.22 未満、20.0.0 以上 20.3.30 未満、19.2.25 以前 | 22.1.4 / 21.2.22 / 20.3.30 | OSV.dev |
推奨対応
- Angularを、ご利用中の系列に対応する修正版(22.1.4 / 21.2.22 / 20.3.30)またはそれ以降の公式最新版へ更新してください。
情報元の原文
OSV.dev
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 `<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:
1. Per DOM specifications, the children of a `<template>` 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 `<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_SCHEMA` or `NO_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 `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: `
<noscript>
<template>
<xmp>{{ payload }}</xmp>
</template>
</noscript>
`
})
export class AppComponent {
// Attacker-controlled input bound via standard text interpolation
payload = '</noscript><img src=x onerror=alert("SSR_TEMPLATE_XSS")>';
}
```
**Vulnerable SSR Output**:
```html
<noscript><template><xmp></noscript><img src=x onerror=alert("SSR_TEMPLATE_XSS")></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.
利用条件:CC BY 4.0
出典: GitHub Advisory Database(OSV.dev 経由で取得)。原文のまま掲載(改変なし)
NVD(National Vulnerability Database / NIST)
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 20.3.30, 21.2.22, and 22.1.4, Angular server-side rendering (SSR) in @angular/platform-server serializes untrusted input inside template content nested in fallback raw-content elements such as noscript, iframe, noembed, and noframes. The Domino serializer's fallbackRawContentTags traversal stopped at the DocumentFragment used by template.content, so matching closing tags in xmp, style, script, comments, or text nodes were not escaped. Standard interpolation with comments or text nodes is reachable without relaxed schemas; literal xmp or style requires CUSTOM_ELEMENTS_SCHEMA or NO_ERRORS_SCHEMA, while Renderer2 imperative DOM construction is unconditionally affected. When HTML5 RAWTEXT browser parsing encounters the unescaped closing tag, it exits the fallback container and interprets trailing markup as active DOM elements, enabling arbitrary JavaScript execution. This issue is fixed in versions 20.3.30, 21.2.22, and 22.1.4.
利用条件:米国政府の著作物(パブリックドメイン)・原文のまま掲載
Copyright 1999-2026 The MITRE Corporation
CVE Usage: MITRE hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Common Vulnerabilities and Exposures (CVE®). Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy.
情報元
- OSV.dev
https://github.com/advisories/GHSA-v3p8-whq6-r5jg - NVD(National Vulnerability Database / NIST)
https://nvd.nist.gov/vuln/detail/CVE-2026-88060