Średnia

Angular SSR: Path Traversal to Sibling Directories in CommonEngine on Windows

  • Ujawniono: 05.10.2026
  • Aktualizacja: 11.10.2026 10:22

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.

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Paczka npm @angular/ssr >= 22.0.0, < 22.1.7, >= 21.0.0, < 21.2.23, >= 20.0.0, < 20.3.36, <= 19.2.27 22.1.7, 21.2.23, 20.3.36

Odnośniki

Ocena CVSS -
Wektor CVSS
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
Słabość (CWE)
CWE-22
Platforma
npm
Paczka
@angular/ssr
Ujawniono
05.10.2026
Aktualizacja
11.10.2026 10:22

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-7g7c-h8rr-7p6q - CC BY 4.0

Historia podatności: @angular/ssr

Wszystkie opisane podatności tej paczki (Paczka npm), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkich wpisów
7
Pierwsza → ostatnia
09.2025 10.2026
Bez poprawki
0
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 1
  • Wysoka 2
  • Średnia 4

Ujawnienia w latach

  1. 2025: 2
  2. 2026: 5
  1. Angular SSR: Path Traversal to Sibling Directories in CommonEngine on Windows ten wpis
    Średnia CVE-2026-104871 >= 22.0.0, < 22.1.7, >= 21.0.0, < 21.2.23, >= 20.0.0, < 20.3.36, <= 19.2.27 22.1.7, 21.2.23, 20.3.36
  2. Średnia CVE-2026-44437 >= 22.0.0-next.0, < 22.0.0-next.7, >= 21.0.0-next.0, < 21.2.9, >= 20.0.0-next.0, < 20.3.25, >= 19.0.0-next.0, < 19.2.25 22.0.0-next.7, 21.2.9, 20.3.25, 19.2.25
  3. Średnia · 6.1 CVE-2026-33397 >= 22.0.0-next.0, < 22.0.0-next.2, >= 21.0.0-next.0, < 21.2.3, >= 20.0.0-next.0, < 20.3.21 22.0.0-next.2, 21.2.3, 20.3.21
  4. Krytyczna CVE-2026-27739 >= 21.2.0-next.0, < 21.2.0-rc.1, >= 21.0.0-next.0, < 21.1.5, >= 20.0.0-next.0, < 20.3.17, < 19.2.21 21.2.0-rc.1, 21.1.5, 20.3.17, 19.2.21
  5. Średnia CVE-2026-27738 >= 21.2.0-next.0, < 21.2.0-rc.1, >= 21.0.0-next.0, < 21.1.5, >= 20.0.0-next.0, < 20.3.17, >= 19.0.0-next.0, < 19.2.21 21.2.0-rc.1, 21.1.5, 20.3.17, 19.2.21
  6. Wysoka CVE-2025-62427 >= 19.0.0-next.0, < 19.2.18, >= 20.0.0-next.0, < 20.3.6, >= 21.0.0-next.0, < 21.0.0-next.8 19.2.18, 20.3.6, 21.0.0-next.8
  7. Wysoka CVE-2025-59052 >= 17.0.0-next.0, < 18.2.21, >= 19.0.0-next.0, < 19.2.16, >= 20.0.0-next.0, < 20.3.0, >= 21.0.0-next.0, < 21.0.0-next.3 18.2.21, 19.2.16, 20.3.0, 21.0.0-next.3

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.