Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. @angular/ssr
  4. ›
  5. CVE-2026-104871

CVE-2026-104871: Angular SSR: Path Traversal to Sibling Directories in CommonEngine on Windows

October 5, 2026

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.

References

  • github.com/advisories/GHSA-7g7c-h8rr-7p6q
  • github.com/angular/angular-cli/commit/645e41a47d21b7651837a4250de99af0509626e2
  • github.com/angular/angular-cli/commit/70748ca8e76fe4b42798719410336119d943e755
  • github.com/angular/angular-cli/commit/bb72145f9ab45aee29f523236b3a25cd0813a841
  • github.com/angular/angular-cli/commit/c3e5982e49705f0f6a913cb94622b4c555d2d914
  • github.com/angular/angular-cli/releases/tag/v20.3.36
  • github.com/angular/angular-cli/releases/tag/v21.2.23
  • github.com/angular/angular-cli/releases/tag/v22.1.7
  • github.com/angular/angular-cli/security/advisories/GHSA-7g7c-h8rr-7p6q
  • nvd.nist.gov/vuln/detail/CVE-2026-104871

Code Behaviors & Features

Detect and mitigate CVE-2026-104871 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions up to 19.2.27, all versions starting from 20.0.0 before 20.3.36, all versions starting from 21.0.0 before 21.2.23, all versions starting from 22.0.0 before 22.1.7

Fixed versions

  • 20.3.36
  • 21.2.23
  • 22.1.7

Solution

Upgrade to versions 20.3.36, 21.2.23, 22.1.7 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

npm/@angular/ssr/CVE-2026-104871.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 06 Oct 2026 12:28:20 +0000.