Description

A major vulnerability in Angular’s server-side rendering (SSR), tracked as CVE-2025-59052, can lead to cross-request data leakage due to a global race condition in the platform injector. When multiple requests are processed concurrently, the global injector previously a module-scoped variable may be shared across sessions. This could expose user-specific data such as authentication tokens, user preferences, or database results to other users. Since the flaw requires no special privileges or interaction, it poses a serious risk in high-traffic environments where attackers can repeatedly issue SSR requests and inspect responses. To fix this, Angular made architectural changes in its SSR handling. The bootstrapApplication() method now requires a BootstrapContext to ensure per-request isolation. Additionally, getPlatform() no longer returns the last created platform (returns null instead), and destroyPlatform() becomes a no-op during SSR. These updates, though breaking for server code, are essential for securing applications. Angular provides automated schematics via ng update for versions 18, 19, and 20 to help developers apply necessary changes. Patches have been released in versions 18.2.14, 19.2.15, 20.3.0, and 21.0.0-next.3 of @angular/platform-server. Until updated, developers can reduce risk by disabling SSR via routing or builder options, removing async logic from bootstrap functions, avoiding getPlatform() calls, and turning off JIT mode in server builds. These steps help prevent leakage of shared platform state. This vulnerability highlights the complexity of SSR in modern frameworks and the importance of isolating request-specific data to maintain user privacy and application security.