{"id":"CVE-2026-101895","aliases":["CVE-2026-101895","GHSA-f67j-2jqw-jpq7"],"related":[],"kind":"vulnerability","state":"published","title":"Angular SSR: Denial of Service (DoS) via Infinite Loop on Malformed DOCTYPE","summary":"Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 20.3.31, 21.2.23, and 22.1.6, the @angular/platform-server DOM emulation parser can enter an infinite synchronous loop when Angular server-side rendering processes attacker-controlled HTML containing an incomplete DOCTYPE that ends with whitespace at end of input. In Domino lib/HTMLParser.js, after_doctype_name_state emits doctype and EOF tokens without advancing nextchar or leaving the fixed-lookahead state, so the scanner repeatedly handles the same EOF marker. A remote unauthenticated attacker can use this condition through server-side HTML parsing paths such as innerHTML binding to consume a Node.js SSR worker at full CPU, starve the event loop, and stop concurrent and subsequent requests. This issue is fixed in versions 20.3.31, 21.2.23, and 22.1.6.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 20.3.31, 21.2.23, and 22.1.6, the @angular/platform-server DOM emulation parser can enter an infinite synchronous loop when Angular server-side rendering processes attacker-controlled HTML containing an incomplete DOCTYPE that ends with whitespace at end of input. In Domino lib/HTMLParser.js, after_doctype_name_state emits doctype and EOF tokens without advancing nextchar or leaving the fixed-lookahead state, so the scanner repeatedly handles the same EOF marker. A remote unauthenticated attacker can use this condition through server-side HTML parsing paths such as innerHTML binding to consume a Node.js SSR worker at full CPU, starve the event loop, and stop concurrent and subsequent requests. This issue is fixed in versions 20.3.31, 21.2.23, and 22.1.6.","source":"cvelist"},{"lang":"en","text":"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.\n\n### Technical Description\nIn 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.\n\nIn 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:\n\n```javascript\ncase -1: // EOF\n  forcequirks();\n  emitDoctype();\n  emitEOF();\n  break;\n```\n\nBecause `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.\n\n### Impact & Reachability\n* **Reachability**: The vulnerability is reachable in any Angular SSR application where untrusted user input is bound to `[innerHTML]`, interpolated into markup, or sanitized on the server.\n* **Impact**: Successful exploitation allows an unauthenticated remote attacker to cause an immediate Denial of Service (DoS) by sending a payload containing an incomplete DOCTYPE (e.g., `<!DOCTYPE html `). The Node.js SSR process locks up at 100% CPU and ceases responding to all concurrent and subsequent HTTP requests.\n\n**Proof of Concept:**\n```ts\nimport { Component } from '@angular/core';\n\n@Component({\n  selector: 'app-root',\n  standalone: true,\n  template: `<div [innerHTML]=\"payload\"></div>`,\n})\nexport class AppComponent {\n  // Attacker-controlled input containing an incomplete DOCTYPE ending with whitespace\n  payload = '<!DOCTYPE html ';\n}\n```\n\n### Workarounds\n* Avoid binding untrusted user input directly to `[innerHTML]` in server-rendered templates; use standard text interpolation (`{{ userInput }}`) or `[textContent]` when raw HTML rendering is not required.\n* Validate or sanitize user input before passing it to `[innerHTML]` on the server by stripping or rejecting strings matching `/^<!DOCTYPE/i`.","format":"markdown","source":"ghsa"}],"published":"2026-09-28T21:31:21.000Z","modified":"2026-10-16T16:00:33.533Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-400","CWE-835"],"affected":[{"ranges":[{"version":"<= 19.2.25","status":"affected"},{"version":">= 20.0.0, < 20.3.31","status":"affected"},{"version":">= 21.0.0, < 21.2.23","status":"affected"},{"version":">= 22.0.0, < 22.1.6","status":"affected"}],"vendor":"angular","product":"angular","source":"cvelist"},{"ranges":[{"version":"<= 19.2.25","status":"affected"},{"version":">= 20.0.0, < 20.3.31","status":"affected"},{"version":">= 21.0.0, < 21.2.23","status":"affected"},{"version":">= 22.0.0, < 22.1.6","status":"affected"}],"vendor":"@angular/","product":"platform-server","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"22.0.0","status":"affected","fixed":"22.1.6"}],"ecosystem":"npm","package":"@angular/platform-server","purl":"pkg:npm/%40angular/platform-server","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"21.0.0","status":"affected","fixed":"21.2.23"}],"ecosystem":"npm","package":"@angular/platform-server","purl":"pkg:npm/%40angular/platform-server","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"20.0.0","status":"affected","fixed":"20.3.31"}],"ecosystem":"npm","package":"@angular/platform-server","purl":"pkg:npm/%40angular/platform-server","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"19.2.25"}],"ecosystem":"npm","package":"@angular/platform-server","purl":"pkg:npm/%40angular/platform-server","source":"ghsa"}],"references":[{"url":"https://github.com/angular/angular/security/advisories/GHSA-f67j-2jqw-jpq7","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular/commit/3db26e2544964d07a520836ad01f02f36ec88e25","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/angular/angular/commit/fc2e8fbc0bda2f5c11585e8a0cbd88c074f5e567","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/angular/domino/commit/4d97473116d000e3fd4d6f75ec98cbd67576fa6f","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/angular/angular/releases/tag/v20.3.31","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/angular/angular/releases/tag/v21.2.23","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/angular/angular/releases/tag/v22.1.6","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/angular/angular","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-10-14T17:37:35.859Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-101895","url":"https://www.cve.org/CVERecord?id=CVE-2026-101895","licence":"CVE Terms of Use","modified":"2026-10-14T17:38:10.017Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f67j-2jqw-jpq7","url":"https://github.com/advisories/GHSA-f67j-2jqw-jpq7","licence":"CC-BY-4.0","modified":"2026-09-28T21:45:03.879Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-101895","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-101895","licence":"Public domain","modified":"2026-10-16T16:00:33.533Z"}],"updatedAt":"2026-11-25T22:59:44.648Z","epss":{"score":0.00872,"percentile":0.59949,"date":"2026-12-01T12:00:22.000Z"}}