Vulnerabilities in pkg:npm/@angular/ssr

PACKAGE
Advisory Identifier: GHSA-7g7c-h8rr-7p6q
Advisory Summary

CVE-2026-104871 is a MODERATE path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Angular SSR libraries in the npm ecosystem. The issue involves path traversal to sibling directories in commonengine on windows. Remediation is available by upgrading affected packages to version 22.1.7, 21.2.23, 20.3.36.

7 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@angular/ssr

7 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@angular/ssr. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7g7c-h8rr-7p6q CVE-2026-104871 MODERATE Angular SSR: Path Traversal to Sibling Directories in CommonEngine on Windows
GHSA-69xr-m8h6-h664 CVE-2026-44437 MODERATE Angular SSR has Open Redirect and Request Steering via Encoded X-Forwarded-Prefix
GHSA-vfx2-hv2g-xj5f CVE-2026-33397 MODERATE Protocol-Relative URL Injection via Single Backslash Bypass in Angular SSR
GHSA-x288-3778-4hhx CVE-2026-27739 CRITICAL Angular SSR is vulnerable to SSRF and Header Injection via request handling pipeline
GHSA-xh43-g2fq-wjrj CVE-2026-27738 MODERATE Angular SSR has an Open Redirect via X-Forwarded-Prefix
GHSA-q63q-pgmf-mxhr CVE-2025-62427 HIGH Angular SSR has a Server-Side Request Forgery (SSRF) flaw
GHSA-68x2-mx4q-78m7 CVE-2025-59052 HIGH Angular SSR: Global Platform Injector Race Condition Leads to Cross-Request Data Leakage

CVE-2026-104871 at a Glance

CVE Identifier CVE-2026-104871
GHSA Identifier GHSA-7g7c-h8rr-7p6q
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Angular SSR
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-104871

To remediate this vulnerability, upgrade all affected Angular SSR dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@angular/ssr fixed: 22.1.7
npm install @angular/ssr@22.1.7
@angular/ssr fixed: 21.2.23
npm install @angular/ssr@21.2.23
@angular/ssr fixed: 20.3.36
npm install @angular/ssr@20.3.36
@angular/ssr fixed: Latest secure release
npm install @angular/ssr@Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @angular/ssr

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-104871, inspect your project dependencies using npm:

npm ls @angular/ssr

Analyze the terminal output to locate any version of Angular SSR in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 22.1.7), your application is affected.

Note: The npm ls @angular/ssr command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Angular SSR, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A Path Traversal vulnerability exists in the prerendered (SSG) page retrieval logic of `CommonEngine` in `@angular/ssr/node` (and `@angular/ssr` in earlier versions). When deployed on Windows, an attacker can craft a request path with backslash directory traversal sequences that causes `CommonEngine` to serve prerendered pages from sibling output directories. The vulnerability occurs due to how relative URLs and Windows file paths are resolved and validated: 1. A request URL containing a backslash parent traversal segment (e.g., `/..\app-admin`) is passed to `CommonEngine.render({ url })`. 2. The engine parses the URL using `new URL(url, 'resolve://')`. Because `resolve://` is a non-special scheme under the WHATWG URL standard, backslashes are not normalized to forward slashes, leaving the `pathname` unnormalized as `/..\app-admin`. 3. The engine constructs the candidate file path using `join(publicPath, pathname, 'index.html')`. On Windows, `path.join` treats `\` as a path delimiter, resolving the parent segment (`..\`) out of `publicPath` (e.g., `dist\app`) into a sibling directory (e.g., `dist\app-admin\index.html`). 4. The containment check (`pagePath.startsWith(normalize(publicPath))`) performs a prefix match without a trailing path delimiter. Because the sibling folder name starts with the configured public folder name (e.g., `dist\app-admin` starts with `dist\app`), the check erroneously succeeds. 5. If the target file exists and contains the Angular SSG marker (`ng-server-context="...ssg..."`), `CommonEngine` reads and serves the sibling page instead of rendering the requested route. ### Impact This vulnerability allows unauthorized access to prerendered static pages from adjacent applications or build outputs: - **Information Disclosure:** Prerendered HTML pages located in sibling directories sharing the same name prefix as the public directory (e.g., an internal administration app `app-admin` adjacent to `app`) can be accessed by unauthorized users. - **Limited Scope:** Only HTML files matching the Angular SSG marker regex are served. Arbitrary non-Angular files, secrets, or configuration files without the SSG context attribute cannot be read through this mechanism. ### Attack Preconditions - The application must use `CommonEngine` from `@angular/ssr/node` (or `@angular/ssr` in v17–v18). - The application must be hosted on Windows (where Node's `path.join` resolves `\` as a path separator). - The application passes a relative request URL (such as `req.url` or `req.originalUrl` without origin) into `CommonEngine.render({ url })`. - A sibling directory exists whose name starts with the same prefix as the configured `publicPath` directory (e.g., `dist\app-admin` alongside `dist\app`). - The targeted sibling directory contains prerendered HTML output containing the Angular SSG marker. ### Affected Versions - `>= 22.0.0, < 22.1.7` - `>= 21.0.0, < 21.2.23` - `>= 20.0.0, < 20.3.36` - `<= 19.2.27` ### Patches - `22.1.7` - `21.2.23` - `20.3.36` > Versions `<= 19.2.27` have reached End of Support / LTS expiration and will not be patched. ### Workarounds Until a patch is applied, developers using `CommonEngine` on Windows can sanitize request URLs in `server.ts` before passing them to `CommonEngine.render`, ensuring backslashes are replaced or that an absolute HTTP URL is constructed: ```ts server.use((req, res, next) => { const { protocol, originalUrl, headers } = req; // Normalize backslashes or construct a full HTTP URL (which forces WHATWG URL normalization) const sanitizedUrl = `${protocol}://${headers.host}${originalUrl.replace(/\\/g, '/')}`; commonEngine .render({ bootstrap, documentFilePath: indexHtml, url: sanitizedUrl, publicPath: distFolder, }) .then((html) => res.send(html)) .catch((err) => next(err)); }); ``` Alternatively, migrate from the deprecated `CommonEngine` to `AngularNodeAppEngine`, which relies on manifest-based route matching rather than direct filesystem path resolution.

CVE-2026-104871 Affected Angular SSR Versions

4 component(s)
Fixed Versions:
22.1.721.2.2320.3.36
Product / Package Ecosystem Affected Versions Fixed Version
@angular/ssr
npm
≥ 22.0.0
< 22.1.7
22.1.7
@angular/ssr
npm
≥ 21.0.0
< 21.2.23
21.2.23
@angular/ssr
npm
≥ 20.0.0
< 20.3.36
20.3.36
@angular/ssr
npm
≤ 19.2.27

References

Frequently Asked Questions

What is CVE-2026-104871?
CVE-2026-104871 is a security vulnerability in Angular SSR involving Path Traversal to Sibling Directories in CommonEngine on Windows under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Angular SSR versions are affected?
Affected versions include releases prior to 22.1.7, 21.2.23, 20.3.36 across affected packages: @angular/ssr.
What version fixes CVE-2026-104871?
Upgrading to 22.1.7, 21.2.23, 20.3.36 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @angular/ssr affected?
Yes, @angular/ssr is affected in releases prior to 22.1.7, 21.2.23, 20.3.36, Latest secure release. Upgrade your dependency to 22.1.7, 21.2.23, 20.3.36, Latest secure release or later.
What CWE is associated with CVE-2026-104871?
CVE-2026-104871 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2026-104871?
Run the dependency tree command: 'npm ls @angular/ssr'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7g7c-h8rr-7p6q",
  "modified" : "2026-10-05T22:53:45Z",
  "published" : "2026-10-05T22:53:45Z",
  "aliases" : [ "CVE-2026-104871" ],
  "summary" : "Angular SSR: Path Traversal to Sibling Directories in CommonEngine on Windows",
  "details" : "A Path Traversal vulnerability exists in the prerendered (SSG) page retrieval logic of `CommonEngine` in `@angular/ssr/node` (and `@angular/ssr` in earlier versions). When deployed on Windows, an attacker can craft a request path with backslash directory traversal sequences that causes `CommonEngine` to serve prerendered pages from sibling output directories.\n\nThe vulnerability occurs due to how relative URLs and Windows file paths are resolved and validated:\n\n1. A request URL containing a backslash parent traversal segment (e.g., `/..\\app-admin`) is passed to `CommonEngine.render({ url })`.\n2. The engine parses the URL using `new URL(url, 'resolve://')`. Because `resolve://` is a non-special scheme under the WHATWG URL standard, backslashes are not normalized to forward slashes, leaving the `pathname` unnormalized as `/..\\app-admin`.\n3. The engine constructs the candidate file path using `join(publicPath, pathname, 'index.html')`. On Windows, `path.join` treats `\\` as a path delimiter, resolving the parent segment (`..\\`) out of `publicPath` (e.g., `dist\\app`) into a sibling directory (e.g., `dist\\app-admin\\index.html`).\n4. The containment check (`pagePath.startsWith(normalize(publicPath))`) performs a prefix match without a trailing path delimiter. Because the sibling folder name starts with the configured public folder name (e.g., `dist\\app-admin` starts with `dist\\app`), the check erroneously succeeds.\n5. If the target file exists and contains the Angular SSG marker (`ng-server-context=\"...ssg...\"`), `CommonEngine` reads and serves the sibling page instead of rendering the requested route.\n\n### Impact\n\nThis vulnerability allows unauthorized access to prerendered static pages from adjacent applications or build outputs:\n\n- **Information Disclosure:** Prerendered HTML pages located in sibling directories sharing the same name prefix as the public directory (e.g., an internal administration app `app-admin` adjacent to `app`) can be accessed by unauthorized users.\n- **Limited Scope:** Only HTML files matching the Angular SSG marker regex are served. Arbitrary non-Angular files, secrets, or configuration files without the SSG context attribute cannot be read through this mechanism.\n\n### Attack Preconditions\n\n- The application must use `CommonEngine` from `@angular/ssr/node` (or `@angular/ssr` in v17–v18).\n- The application must be hosted on Windows (where Node's `path.join` resolves `\\` as a path separator).\n- The application passes a relative request URL (such as `req.url` or `req.originalUrl` without origin) into `CommonEngine.render({ url })`.\n- A sibling directory exists whose name starts with the same prefix as the configured `publicPath` directory (e.g., `dist\\app-admin` alongside `dist\\app`).\n- The targeted sibling directory contains prerendered HTML output containing the Angular SSG marker.\n\n### Affected Versions\n\n- `>= 22.0.0, < 22.1.7`\n- `>= 21.0.0, < 21.2.23`\n- `>= 20.0.0, < 20.3.36`\n- `<= 19.2.27`\n\n### Patches\n\n- `22.1.7`\n- `21.2.23`\n- `20.3.36`\n\n> Versions `<= 19.2.27` have reached End of Support / LTS expiration and will not be patched.\n\n### Workarounds\n\nUntil a patch is applied, developers using `CommonEngine` on Windows can sanitize request URLs in `server.ts` before passing them to `CommonEngine.render`, ensuring backslashes are replaced or that an absolute HTTP URL is constructed:\n\n```ts\nserver.use((req, res, next) => {\n  const { protocol, originalUrl, headers } = req;\n\n  // Normalize backslashes or construct a full HTTP URL (which forces WHATWG URL normalization)\n  const sanitizedUrl = `${protocol}://${headers.host}${originalUrl.replace(/\\\\/g, '/')}`;\n\n  commonEngine\n    .render({\n      bootstrap,\n      documentFilePath: indexHtml,\n      url: sanitizedUrl,\n      publicPath: distFolder,\n    })\n    .then((html) => res.send(html))\n    .catch((err) => next(err));\n});\n```\n\nAlternatively, migrate from the deprecated `CommonEngine` to `AngularNodeAppEngine`, which relies on manifest-based route matching rather than direct filesystem path resolution.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "22.0.0"
      }, {
        "fixed" : "22.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "21.0.0"
      }, {
        "fixed" : "21.2.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "20.0.0"
      }, {
        "fixed" : "20.3.36"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "19.2.27"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/security/advisories/GHSA-7g7c-h8rr-7p6q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-104871"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/commit/645e41a47d21b7651837a4250de99af0509626e2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/commit/70748ca8e76fe4b42798719410336119d943e755"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/commit/bb72145f9ab45aee29f523236b3a25cd0813a841"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/commit/c3e5982e49705f0f6a913cb94622b4c555d2d914"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/angular/angular-cli"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/releases/tag/v20.3.36"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/releases/tag/v21.2.23"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/releases/tag/v22.1.7"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-05T22:53:45Z",
    "nvd_published_at" : "2026-10-02T20:17:00Z"
  }
}