CVE-2025-59052: Angular SSR Global Platform Injector Race Condition Vulnerability

HIGH
Advisory Identifier: GHSA-68x2-mx4q-78m7
CWE-362
Published
Advisory Summary

CVE-2025-59052 is a HIGH global platform injector race condition vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Angular SSR libraries in the npm ecosystem. The issue involves global platform injector race condition leads to cross-request data leakage. Remediation is available by upgrading affected packages to version 18.2.14, 20.3.0, 19.2.15, 21.0.0-next.3, 18.2.21, 19.2.16.

CVE-2025-59052 at a Glance

CVE Identifier CVE-2025-59052
GHSA Identifier GHSA-68x2-mx4q-78m7
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Angular SSR
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-59052

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/platform-server fixed: 18.2.14
npm install @angular/platform-server@18.2.14
@angular/platform-server fixed: 20.3.0
npm install @angular/platform-server@20.3.0
@angular/platform-server fixed: 19.2.15
npm install @angular/platform-server@19.2.15
@angular/platform-server fixed: 21.0.0-next.3
npm install @angular/platform-server@21.0.0-next.3
@angular/ssr fixed: 18.2.21
npm install @angular/ssr@18.2.21
@angular/ssr fixed: 19.2.16
npm install @angular/ssr@19.2.16
@angular/ssr fixed: 20.3.0
npm install @angular/ssr@20.3.0
@angular/ssr fixed: 21.0.0-next.3
npm install @angular/ssr@21.0.0-next.3
@nguniversal/common fixed: Latest secure release
npm install @nguniversal/common@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/platform-server

How to Check if You Are Affected

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

npm ls @angular/platform-server

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 18.2.14), your application is affected.

Note: The npm ls @angular/platform-server 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-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. 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

### 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: ```ts // 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: ```sh # 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: ```sh # 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. ### Patches The issue has been patched in [all active release lines](https://angular.dev/reference/releases#actively-supported-versions) 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 ### Workarounds * Disable SSR via [Server Routes](https://angular.dev/guide/ssr#server-routing) (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 * https://github.com/angular/angular/pull/63562 * https://github.com/angular/angular-cli/pull/31108

CVE-2025-59052 Affected Angular SSR Versions

9 component(s)
Fixed Versions:
18.2.1420.3.019.2.1521.0.0-next.318.2.2119.2.16
Product / Package Ecosystem Affected Versions Fixed Version
@angular/platform-server
npm
≥ 16.0.0-next.0
< 18.2.14
18.2.14
@angular/platform-server
npm
≥ 20.0.0-next.0
< 20.3.0
20.3.0
@angular/platform-server
npm
≥ 19.0.0-next.0
< 19.2.15
19.2.15
@angular/platform-server
npm
≥ 21.0.0-next.0
< 21.0.0-next.3
21.0.0-next.3
@angular/ssr
npm
≥ 17.0.0-next.0
< 18.2.21
18.2.21
@angular/ssr
npm
≥ 19.0.0-next.0
< 19.2.16
19.2.16
@angular/ssr
npm
≥ 20.0.0-next.0
< 20.3.0
20.3.0
@angular/ssr
npm
≥ 21.0.0-next.0
< 21.0.0-next.3
21.0.0-next.3
@nguniversal/common
npm
≥ 16.0.0-next.0
≤ 16.2.0

References

Frequently Asked Questions

What is CVE-2025-59052?
CVE-2025-59052 is a security vulnerability in Angular SSR involving Global Platform Injector Race Condition Leads to Cross-Request Data Leakage under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Angular SSR versions are affected?
Affected versions include releases prior to 18.2.14, 20.3.0, 19.2.15, 21.0.0-next.3, 18.2.21, 19.2.16 across affected packages: @angular/platform-server, @angular/ssr, @nguniversal/common.
What version fixes CVE-2025-59052?
Upgrading to 18.2.14, 20.3.0, 19.2.15, 21.0.0-next.3, 18.2.21, 19.2.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @angular/platform-server affected?
Yes, @angular/platform-server is affected in releases prior to 18.2.14, 20.3.0, 19.2.15, 21.0.0-next.3. Upgrade your dependency to 18.2.14, 20.3.0, 19.2.15, 21.0.0-next.3 or later.
Is @angular/ssr affected?
Yes, @angular/ssr is affected in releases prior to 18.2.21, 19.2.16, 20.3.0, 21.0.0-next.3. Upgrade your dependency to 18.2.21, 19.2.16, 20.3.0, 21.0.0-next.3 or later.
What CWE is associated with CVE-2025-59052?
CVE-2025-59052 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check npm dependencies for CVE-2025-59052?
Run the dependency tree command: 'npm ls @angular/platform-server'. 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-68x2-mx4q-78m7",
  "modified" : "2025-09-10T21:56:01Z",
  "published" : "2025-09-10T21:56:01Z",
  "aliases" : [ "CVE-2025-59052" ],
  "summary" : "Angular SSR: Global Platform Injector Race Condition Leads to Cross-Request Data Leakage",
  "details" : "### Impact\n\nAngular 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.\n\nIn 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.\n\nThe following APIs were vulnerable and required SSR-only breaking changes:\n\n* `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.\n* `getPlatform`: This function previously returned the last platform instance that was created. It now always returns `null` in a server environment.\n* `destroyPlatform`: This function previously destroyed the last platform instance that was created. It's now a no-op when called in a server environment.\n\nFor `bootstrapApplication`, the framework now provides a new argument to the application's bootstrap function:\n\n```ts\n// Before:\nconst bootstrap = () => bootstrapApplication(AppComponent, config);\n\n// After:\nconst bootstrap = (context: BootstrapContext) =>\n  bootstrapApplication(AppComponent, config, context);\n```\n\nAs is usually the case for changes to Angular, an automatic schematic will take care of these code changes as part of ng update:\n\n```sh\n# For apps on Angular v20:\nng update @angular/cli @angular/core\n\n# For apps on Angular v19:\nng update @angular/cli@19 @angular/core@19\n\n# For apps on Angular v18:\nng update @angular/cli@18 @angular/core@18\n```\n\nThe schematic can also be invoked explicitly if the version bump was pulled in independently:\n\n```sh\n# For apps on Angular v20:\nng update @angular/core --name add-bootstrap-context-to-server-main\n\n# For apps on Angular v19:\nng update @angular/core@19 --name add-bootstrap-context-to-server-main\n\n# For apps on Angular v18:\nng update @angular/core@18 --name add-bootstrap-context-to-server-main\n```\n\nFor applications that still use `CommonEngine`, the `bootstrap` property in `CommonEngineOptions` also gains the same `context` argument in the patched versions of Angular.\n\nIn 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.\n\n### Patches\n\nThe issue has been patched in [all active release lines](https://angular.dev/reference/releases#actively-supported-versions) as well as in the v21 prerelease:\n\n* `@angular/platform-server`: 21.0.0-next.3\n* `@angular/platform-server`: 20.3.0\n* `@angular/platform-server`: 19.2.15\n* `@angular/platform-server:` 18.2.14\n\n* `@angular/ssr`: 21.0.0-next.3\n* `@angular/ssr`: 20.3.0\n* `@angular/ssr`: 19.2.16\n* `@angular/ssr`: 18.2.21\n\n### Workarounds\n\n* Disable SSR via [Server Routes](https://angular.dev/guide/ssr#server-routing) (v19+) or builder options.\n* Remove any asynchronous behavior from custom `bootstrap` functions.\n* Remove uses of `getPlatform()` in application code.\n* Ensure that the server build defines `ngJitMode` as false.\n\n### References\n\n* https://github.com/angular/angular/pull/63562\n* https://github.com/angular/angular-cli/pull/31108",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/platform-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "16.0.0-next.0"
      }, {
        "fixed" : "18.2.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/platform-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "20.0.0-next.0"
      }, {
        "fixed" : "20.3.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/platform-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "19.0.0-next.0"
      }, {
        "fixed" : "19.2.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/platform-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "21.0.0-next.0"
      }, {
        "fixed" : "21.0.0-next.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "17.0.0-next.0"
      }, {
        "fixed" : "18.2.21"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "19.0.0-next.0"
      }, {
        "fixed" : "19.2.16"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "20.0.0-next.0"
      }, {
        "fixed" : "20.3.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "21.0.0-next.0"
      }, {
        "fixed" : "21.0.0-next.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nguniversal/common"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "16.0.0-next.0"
      }, {
        "last_affected" : "16.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/security/advisories/GHSA-68x2-mx4q-78m7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-59052"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/pull/31108"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular/pull/63562"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/angular/angular"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-10T21:56:01Z",
    "nvd_published_at" : "2025-09-10T21:15:37Z"
  }
}