CVE-2025-59052

CVE-2025-59052 is a high-severity race condition vulnerability in @angular/platform-server (npm), affecting versions >= 16.0.0-next.0, < 18.2.14. It is fixed in 18.2.14, 20.3.0, 19.2.15, 21.0.0-next.3, 18.2.21, 19.2.16.

Summary

Workarounds

  • Disable SSR via Server Routes (v19+) or builder options.
  • Remove any asynchronous behavior from custom bootstrap functions.
  • Remove uses of getPlatform() in application code.
  • Ensure that the server build defines ngJitMode as false.

References

Impact

Angular uses a DI container (the "platform injector") to hold request-specific state during server-side rendering. For historical reasons, the container was stored as a JavaScript module-scoped global variable. When multiple requests are processed concurrently, they could inadvertently share or overwrite the global injector state.

In practical terms, this can lead to one request responding with data meant for a completely different request, leaking data or tokens included on the rendered page or in response headers. As long as an attacker had network access to send any traffic that received a rendered response, they may have been able to send a large number of requests and then inspect the responses for information leaks.

The following APIs were vulnerable and required SSR-only breaking changes:

  • bootstrapApplication: This function previously implicitly retrieved the last platform injector that was created. It now requires an explicit BootstrapContext in a server environment. This function is only used for standalone applications. NgModule-based applications are not affected.
  • getPlatform: This function previously returned the last platform instance that was created. It now always returns null in a server environment.
  • destroyPlatform: This function previously destroyed the last platform instance that was created. It's now a no-op when called in a server environment.

For bootstrapApplication, the framework now provides a new argument to the application's bootstrap function:

// Before:
const bootstrap = () => bootstrapApplication(AppComponent, config);

// After:
const bootstrap = (context: BootstrapContext) =>
  bootstrapApplication(AppComponent, config, context);

As is usually the case for changes to Angular, an automatic schematic will take care of these code changes as part of ng update:

# For apps on Angular v20:
ng update @angular/cli @angular/core

# For apps on Angular v19:
ng update @angular/cli@19 @angular/core@19

# For apps on Angular v18:
ng update @angular/cli@18 @angular/core@18

The schematic can also be invoked explicitly if the version bump was pulled in independently:

# For apps on Angular v20:
ng update @angular/core --name add-bootstrap-context-to-server-main

# For apps on Angular v19:
ng update @angular/core@19 --name add-bootstrap-context-to-server-main

# For apps on Angular v18:
ng update @angular/core@18 --name add-bootstrap-context-to-server-main

For applications that still use CommonEngine, the bootstrap property in CommonEngineOptions also gains the same context argument in the patched versions of Angular.

In local development (ng serve), Angular CLI triggered a codepath for Angular's "JIT" feature on the server even in applications that weren't using it in the browser. The codepath introduced async behavior between platform creation and application bootstrap, triggering the race condition even if an application didn't explicitly use getPlatform or custom async logic in bootstrap. Angular applications should never run in this mode outside of local development.

Multiple concurrent operations access a shared resource without proper synchronization, producing unpredictable results depending on timing. Typical impact: TOCTOU exploits, data corruption, or privilege escalation.

Affected versions

@angular/platform-server (>= 16.0.0-next.0, < 18.2.14) @angular/platform-server (>= 20.0.0-next.0, < 20.3.0) @angular/platform-server (>= 19.0.0-next.0, < 19.2.15) @angular/platform-server (>= 21.0.0-next.0, < 21.0.0-next.3) @angular/ssr (>= 17.0.0-next.0, < 18.2.21) @angular/ssr (>= 19.0.0-next.0, < 19.2.16) @angular/ssr (>= 20.0.0-next.0, < 20.3.0) @angular/ssr (>= 21.0.0-next.0, < 21.0.0-next.3) @nguniversal/common (>= 16.0.0-next.0, <= 16.2.0)

Security releases

@angular/platform-server → 18.2.14 (npm) @angular/platform-server → 20.3.0 (npm) @angular/platform-server → 19.2.15 (npm) @angular/platform-server → 21.0.0-next.3 (npm) @angular/ssr → 18.2.21 (npm) @angular/ssr → 19.2.16 (npm) @angular/ssr → 20.3.0 (npm) @angular/ssr → 21.0.0-next.3 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

The issue has been patched in all active release lines as well as in the v21 prerelease:

  • @angular/platform-server: 21.0.0-next.3

  • @angular/platform-server: 20.3.0

  • @angular/platform-server: 19.2.15

  • @angular/platform-server: 18.2.14

  • @angular/ssr: 21.0.0-next.3

  • @angular/ssr: 20.3.0

  • @angular/ssr: 19.2.16

  • @angular/ssr: 18.2.21

Frequently Asked Questions

  1. What is CVE-2025-59052? CVE-2025-59052 is a high-severity race condition vulnerability in @angular/platform-server (npm), affecting versions >= 16.0.0-next.0, < 18.2.14. It is fixed in 18.2.14, 20.3.0, 19.2.15, 21.0.0-next.3, 18.2.21, 19.2.16. Multiple concurrent operations access a shared resource without proper synchronization, producing unpredictable results depending on timing.
  2. Which packages are affected by CVE-2025-59052?
    • @angular/platform-server (npm) (versions >= 16.0.0-next.0, < 18.2.14)
    • @angular/ssr (npm) (versions >= 17.0.0-next.0, < 18.2.21)
    • @nguniversal/common (npm) (versions >= 16.0.0-next.0, <= 16.2.0)
  3. Is there a fix for CVE-2025-59052? Yes. CVE-2025-59052 is fixed in 18.2.14, 20.3.0, 19.2.15, 21.0.0-next.3, 18.2.21, 19.2.16. Upgrade to this version or later.
  4. Is CVE-2025-59052 exploitable, and should I be worried? Whether CVE-2025-59052 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2025-59052 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2025-59052?
    • Upgrade @angular/platform-server to 18.2.14 or later
    • Upgrade @angular/platform-server to 20.3.0 or later
    • Upgrade @angular/platform-server to 19.2.15 or later
    • Upgrade @angular/platform-server to 21.0.0-next.3 or later
    • Upgrade @angular/ssr to 18.2.21 or later
    • Upgrade @angular/ssr to 19.2.16 or later
    • Upgrade @angular/ssr to 20.3.0 or later
    • Upgrade @angular/ssr to 21.0.0-next.3 or later

Other vulnerabilities in @angular/platform-server

CVE-2026-50556CVE-2026-50555CVE-2026-50168CVE-2026-46417CVE-2026-41423

Stop the waste.
Protect your environment with Kodem.