@angular/platform-server
Affected
- introduced
22.0.0, fixed22.1.6(semver)
Fixed versions
22.1.6
Fix
- Fixed version
22.1.6npm install @angular/[email protected]
Advisory
Also known as: CVE-2026-101895
Angular SSR: Denial of Service (DoS) via Infinite Loop on Malformed DOCTYPE
A Denial of Service (DoS) vulnerability exists in @angular/platform-server's DOM emulation parser (domino). When processing untrusted user input containing an incomplete DOCTYPE declaration ending with whitespace before EOF (such as <!DOCTYPE html ), the HTML parser enters an infinite synchronous loop, pegging CPU utilization at 100% and completely freezing the Node.js server process.
Technical Description
In Angular Server-Side Rendering (SSR), @angular/platform-server uses domino to parse and sanitize HTML bound through template bindings (such as [innerHTML]) or manipulated via DOM APIs.
In Domino's HTML parser (lib/HTMLParser.js), tokenizer states that specify fixed lookahead—such as after_doctype_name_state (lookahead = 6)—rely on the state handler function to explicitly advance the character index pointer (nextchar). While branches for whitespace, >, and keyword matching advance nextchar, the EOF branch (case -1: // EOF) emitted doctype and EOF tokens without advancing nextchar or transitioning out of the state:
case -1: // EOF
forcequirks();
emitDoctype();
emitEOF();
break;
Because nextchar remained unchanged pointing to the EOF marker character (\uFFFF), the scanner loop (while (nextchar < numchars)) repeatedly re-invoked after_doctype_name_state with codepoint = EOF indefinitely. In Node.js's single-threaded runtime, this synchronous loop starves the event loop entirely.
Impact & Reachability
[innerHTML], interpolated into markup, or sanitized on the server.<!DOCTYPE html ). The Node.js SSR process locks up at 100% CPU and ceases responding to all concurrent and subsequent HTTP requests.Proof of Concept:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
standalone: true,
template: `<div [innerHTML]="payload"></div>`,
})
export class AppComponent {
// Attacker-controlled input containing an incomplete DOCTYPE ending with whitespace
payload = '<!DOCTYPE html ';
}
Workarounds
[innerHTML] in server-rendered templates; use standard text interpolation ({{ userInput }}) or [textContent] when raw HTML rendering is not required.[innerHTML] on the server by stripping or rejecting strings matching /^<!DOCTYPE/i.High Basis: The source's own band: HIGH
22.0.0, fixed 22.1.6 (semver)22.1.6
22.1.6npm install @angular/[email protected]21.0.0, fixed 21.2.23 (semver)21.2.23
21.2.23npm install @angular/[email protected]20.0.0, fixed 20.3.31 (semver)20.3.31
20.3.31npm install @angular/[email protected]0, last affected 19.2.25 (semver)None listed
No fixed version is listed.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0