Listen to this Post
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.
CPU utilization reaches 100% and the Node.js server process completely freezes.
In Angular Server-Side Rendering (SSR), @angular/platform-server uses domino to parse and sanitize HTML bound through template bindings, such as [bash], or manipulated via DOM APIs.
In Domino’s HTML parser, lib/HTMLParser.js, tokenizer states specify fixed lookahead.
For example, after_doctype_name_state uses lookahead = 6.
These states rely on the state handler function to explicitly advance the character index pointer, nextchar.
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.
The EOF branch code:
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.
Reachability: The vulnerability is reachable in any Angular SSR application where untrusted user input is bound to [bash], interpolated into markup, or sanitized on the server.
Impact: Successful exploitation allows an unauthenticated remote attacker to cause an immediate Denial of Service by sending a payload containing an incomplete DOCTYPE, e.g., <!DOCTYPE html .
The Node.js SSR process locks up at 100% CPU.
It ceases responding to all concurrent and subsequent HTTP requests.
Proof of Concept:
import { Component } from ‘@angular/core’;
@Component({
selector: ‘app-root’,
standalone: true,
template: `
`,
})
export class AppComponent {
payload = ‘
}
Workarounds:
Avoid binding untrusted user input directly to [bash] in server-rendered templates.
Use standard text interpolation {{ userInput }} or [bash] when raw HTML rendering is not required.
Validate or sanitize user input before passing it to [bash] on the server.
Strip or reject strings matching /^
References: Not provided in .
This technical description shows a parser state advancement flaw leading to CPU exhaustion.
The core issue is an EOF branch that does not advance nextchar.
The loop condition remains true because nextchar < numchars continues.
The parser repeatedly processes the same EOF codepoint.
No asynchronous yield occurs during the loop.
The event loop cannot handle incoming requests.
This creates a denial of service condition.
Server-side rendering becomes unavailable.
The vulnerability affects the domino parser used by Angular SSR.
The payload is simple and unauthenticated.
The attack requires binding untrusted input.
The workaround is input validation or avoiding raw HTML binding.
DailyCVE Form:
Platform: Angular platform-server
Version: Not specified
Vulnerability: DoS via DOCTYPE
Severity: Not provided
date: Not provided
Prediction: Patch date unknown
What Undercode Say:
Analytics:
grep -R “after_doctype_name_state” node_modules/domino/lib/HTMLParser.js
npm ls @angular/platform-server domino
node -e “const s=’
node -e “const domino=require(‘domino’); const w=domino.createWindow(); w.document.body.innerHTML='<!DOCTYPE html ‘;”
curl -X POST http://localhost:4200/ -H “Content-Type: text/html” –data ‘<!DOCTYPE html ‘
payload = ‘
template: `
`
Exploit: (Educational Purposes!)
payload = ‘
curl -s -X POST http://localhost:4200/ -H “Content-Type: text/html” –data ‘<!DOCTYPE html ‘
node -e “const domino=require(‘domino’); const w=domino.createWindow(); w.document.body.innerHTML='<!DOCTYPE html ‘;”
Protection: from this CVE Impact:
Use {{ userInput }}
Use [bash]
Validate input
Reject /^
Avoid [bash]
Sanitize server-side
Update domino
Update Angular
Patch date unknown
Impact:
100% CPU
Node.js freeze
SSR unavailable
Unauthenticated remote DoS
Event loop starved
Concurrent requests fail
Subsequent requests fail
🎯Let’s Practice Exploiting & Learn Patching For Free:
🎓 Live Courses & Certifications:
Join Undercode Academy for Verified Certifications
🚀 Request a Custom Project:
Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

