Packages / @angular/router / Security

HighVulnerabilityGHSA-62vg-58rm-qff7CVE-2026-111752Published 20 Oct 2026

@angular/router: Denial of Service via Unmatched Empty-Path Outlet Route Matching in Server-Side Rendering (SSR)

Affected releases · @angular/router

  • 22.x22.0.0 – 22.2.0Fixed in 22.2.1
  • 21.x21.0.0 – 21.2.24Fixed in 21.2.25
  • 20.x20.0.0 – 20.3.32Fixed in 20.3.33
  • 19.x19.0.0 – 19.2.25No fix on this line yet
  • 18.x and older0.0.0 – 18.2.14No fix, no longer updated

On 22.x, the newest line:

npm install @angular/router@22.2.1
22.x
  1. Affected

    22.0.0 – 22.2.0

    19 releases

  2. Fixed

    22.2.1 – 22.2.3

    3 releases, latest

21.x
  1. Affected

    21.0.0 – 21.2.24

    42 releases

  2. Fixed

    21.2.25

    1 release

20.x
  1. Affected

    20.0.0 – 20.3.32

    54 releases

  2. Fixed

    20.3.33 – 20.3.34

    2 releases

19.x
  1. Affected

    19.0.0 – 19.2.25

    43 releases

18.x
  1. Affected

    18.0.0 – 18.2.14

    29 releases

17.x
  1. Affected

    17.0.0 – 17.3.12

    32 releases

16.x
  1. Affected

    16.0.0 – 16.2.12

    30 releases

15.x
  1. Affected

    15.0.0 – 15.2.10

    22 releases

14.x
  1. Affected

    14.0.0 – 14.3.0

    26 releases

13.x
  1. Affected

    13.0.0 – 13.4.0

    30 releases

12.x
  1. Affected

    12.0.0 – 12.2.17

    30 releases

11.x
  1. Affected

    11.0.0 – 11.2.14

    28 releases

10.x
  1. Affected

    10.0.0 – 10.2.5

    28 releases

9.x
  1. Affected

    9.0.0 – 9.1.13

    22 releases

8.x
  1. Affected

    8.0.0 – 8.2.14

    23 releases

7.x
  1. Affected

    7.0.0 – 7.2.16

    27 releases

6.x
  1. Affected

    6.0.0 – 6.1.10

    20 releases

5.x
  1. Affected

    5.0.0 – 5.2.11

    22 releases

4.x
  1. Affected

    4.0.0 – 4.4.7

    29 releases

3.x
  1. Affected

    3.0.0 – 3.4.10

    24 releases

0.x
  1. Affected

    0.0.0 – 0.2.0

    4 releases

590 stable releases of @angular/router, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for @angular/router. It is read in your browser and sent nowhere.

What happens

A denial of service (DoS) vulnerability was identified in @angular/router when Server-Side Rendering (SSR) is enabled on Node.js (V8).

During route recognition, @angular/router fails to validate whether an auxiliary outlet segment in the URL matches a route configured for that specific outlet name. Because unconfigured empty-path outlet groups (such as a:/(), x:/(...), or ///(...)) are not rejected during matching, the router repeatedly re-evaluates the route configuration against each arbitrary outlet segment provided in the URL.

When a request URL contains multiple arbitrary empty-path outlet segments, this improper matching forces the router to instantiate duplicate ActivatedRouteSnapshot trees, repeatedly execute canMatch guards and route resolvers, and allocate separate copies of route parameters and queryParams for each unconfigured outlet.

An unauthenticated remote attacker can exploit this behavior by sending requests with crafted outlet segments to exhaust the Node.js memory heap or overwhelm CPU resources, leading to SSR worker termination and service disruption.

Impact

Successful exploitation allows an unauthenticated remote attacker to exhaust the Node.js heap with a single crafted request or a small number of concurrent requests, terminating the SSR worker process with a fatal JavaScript heap out-of-memory crash. When the matched routes declare canMatch guards or resolvers, a single short request can also trigger repeated guard or resolver executions, increasing load on backend services and holding worker connections open.

  • Transient Allocation: Memory is released once route recognition completes; there is no persistent memory leak. The primary impact is process termination.

  • Client-side SPAs Unaffected: Client-side Angular applications running in the browser are not vulnerable, as browser memory consumption does not cross a security boundary.

  • Prerendering (SSG) Unaffected: Build-time prerendering does not process attacker-supplied request URLs.

Attack Preconditions & Vulnerable Configurations

An application is affected only if all of the following conditions are met:

  1. SSR Enabled: The application renders on demand on a Node.js / V8 server.

  2. Susceptible Route Configuration: At least one level of the route configuration contains either:

    • an empty-path (path: "") route (e.g., {path: "", component: ShopPage}), or

    • a route assigned to a named outlet (e.g., {path: "dashboard", children: [{path: ":id", outlet: "detail", component: DetailPanel}]}).

  3. Upstream Request Line Forwarding: Request lines reach the Node.js process without being rejected upstream by edge proxies. Node.js accepts request headers up to 16 KiB by default. Guard/resolver amplification requires only a short URL.

  4. Constrained Heap Size: Worker heaps are sized small enough relative to the request payload and concurrency (e.g., containers or serverless instances configured with 128 MiB–1 GiB).

Exploit Payload Examples

Against a configuration with empty-path (path: "") routes and query parameters:

GET /shop/(a:/()//b:/()//c:/()//...)?param1=value&param2=value... HTTP/1.1
Host: example.com

Against a configuration with named-outlet or sibling routes:

GET /dashboard/(detail:1//x:/(detail:1//x:/(...)//y:/(...))//y:/(...)) HTTP/1.1
Host: example.com

Patches

The issue is resolved in angular/angular#71055. The router now requires every child outlet segment group to match a route configured for its target outlet before unwrapping child segments or completing a match, and prevents unconfigured empty-path outlet groups from matching routes declared for other outlets.

Patched versions:

  • 22.2.1

  • 21.2.25

  • 20.3.33

Versions prior to v20 are also affected but are no longer supported and will not receive a patch.

Workarounds & Mitigations

If you cannot immediately upgrade to a patched version, apply one or more of the following mitigations:

  1. Reject Parenthesized or Empty-Path Outlet URLs in Middleware or WAF (Recommended): In @angular/router, auxiliary outlet groups in a URL always use parentheses (...), and empty-path outlet groups in a URL always take the form :/( , (/ , or ///( .

    • If your application does not use named (auxiliary) outlets in URLs, reject requests whose path contains ( or ) before Angular SSR handles the request.

    • If your application does use named outlets, reject requests whose path contains empty-path outlet sequences (:/( , (/ , or ///( ).

    Unlike URL length limits, this completely blocks both heap exhaustion and short-URL guard/resolver amplification:

    // server.ts (placed before Angular SSR handler)
    app.use((req, res, next) => {
      let pathname: string;
      try {
        pathname = decodeURI(req.url.split(/[?#]/, 1)[0]);
      } catch {
        res.status(400).send("Bad Request");
        return;
      }
    
      // Option A: If the app does not use named outlets in URLs, block all parenthesized groups:
      if (/[()]/.test(pathname)) {
        res.status(400).send("Bad Request");
        return;
      }
    
      // Option B: If the app uses named outlets, block only empty-path outlet groups:
      if (/:\/\(|\(\//\(|\/\/\/\(/.test(pathname)) {
        res.status(400).send("Bad Request");
        return;
      }
    
      next();
    });
  2. Limit URL Length at Reverse Proxy or Middleware: Configure your edge proxy, web application firewall (WAF), or reverse proxy to reject requests with excessively long URLs (e.g., exceeding 2,048 bytes). The outlet portion of the payload is in the path, so limit the full request target, not only the query string. This reduces, but does not eliminate, guard/resolver amplification, which requires only a short URL.

  3. Increase Node.js Old Space: Increasing --max-old-space-size raises the request size and concurrency required to exhaust memory, though it does not eliminate the issue.