Skip to content

Apollo Embedded Sandbox and Explorer vulnerable to CSRF via window.postMessage origin-validation bypass

High severity GitHub Reviewed Published Sep 25, 2025 in apollographql/embeddable-explorer • Updated Sep 29, 2025

Package

npm @apollo/explorer (npm)

Affected versions

< 3.7.3

Patched versions

3.7.3
npm @apollo/sandbox (npm)
< 2.7.2
2.7.2

Description

Impact

A Cross-Site Request Forgery (CSRF) vulnerability was identified in Apollo’s Embedded Sandbox and Embedded Explorer.

The vulnerability arises from missing origin validation in the client-side code that handles window.postMessage events. A malicious website can send forged messages to the embedding page, causing the victim’s browser to execute arbitrary GraphQL queries or mutations against their GraphQL server while authenticated with the victim’s cookies.

Who is impacted

Anyone embedding Apollo Sandbox or Apollo Explorer in their website may have been affected by this vulnerability.

  • Users who embed Apollo Sandbox or Apollo Explorer in their websites via npm packages (@apollo/sandbox and @apollo/explorer) or direct links to Apollo’s CDN.
  • Users running Apollo Router with embedded Sandbox enabled. This served the vulnerable code from Apollo’s CDN.
  • Users running Apollo Server with embedded Sandbox or Explorer enabled. Embedded Sandbox is enabled by default when NODE_ENV is not set to production, and embedded Sandbox and Explorer can also be enabled in production mode via landing page plugins. This served the vulnerable code from Apollo’s CDN.

While all of the above methods of serving Embedded Sandbox and Explorer were vulnerable, Apollo has already updated its CDN to remove all vulnerable versions. Unless you install the npm package @apollo/sandbox or @apollo/explorer directly into your website’s front end code, no action is necessary: the vulnerability has already been mitigated.

Users who do not embed Sandbox/Explorer on their websites, or who only run Apollo Router/Server with production defaults were never impacted. The use of non-embedded Sandbox and Explorer hosted on studio.apollographql.com is not vulnerable.

Scope of impact

The vulnerability allows a malicious website to open the vulnerable website in a new window and force it to send GraphQL requests to its origin. The requests themselves are not "cross-origin" as they are directly issued from the vulnerable website, but their contents are dictated by the malicious website.

The malicious website cannot read the responses to the GraphQL operations, but the operations may be mutations with side effects (such as using credentials to update app-specific data access controls). These operations can contain the browser user's cookies, and the vulnerable website may be on a private network otherwise inaccessible to the attacker. Operations sent this way look and exactly like legitimate operations sent by a human interacting with the embedded Sandbox or Explorer.

Patches

The issue has been fixed by adding strict origin validation to DOM message handling.

  • @apollo/sandbox: Patched in v2.7.2 and later
  • @apollo/explorer: Patched in v3.7.3 and later
  • Apollo’s CDN embeds have been updated to patched versions. This protects embeds based on <script> tags pointing to Apollo’s CDN, as well as the Apollo Router and Apollo Server features. No action is necessary to adopt the fix in this case.

If you manually edited the <script> tag provided by the Explorer or Sandbox UI to replace the version string _latest, v2, or v3 with a specific git-style SHA, you may find that the Explorer or Sandbox UI does not currently load. To fix this, use a supported URL instead, as documented for Sandbox or Explorer. (The third-party Go GraphQL server gqlgen provides a function ApolloSandboxHandler which serves an unsupported URL and was broken by our mitigations; upgrading to gqlgen v0.17.81 will resolve this issue.)

Workarounds

  • If you are using Apollo Server, ensure NODE_ENV=production is set in production to avoid unintentionally serving embedded Sandbox.
  • Customers not using embedded Sandbox/Explorer are not affected and do not need to take action.

References

References

Published to the GitHub Advisory Database Sep 26, 2025
Reviewed Sep 26, 2025
Published by the National Vulnerability Database Sep 26, 2025
Last updated Sep 29, 2025

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(2nd percentile)

Weaknesses

Origin Validation Error

The product does not properly verify that the source of data or communication is valid. Learn more on MITRE.

Cross-Site Request Forgery (CSRF)

The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. Learn more on MITRE.

CVE ID

CVE-2025-59845

GHSA ID

GHSA-w87v-7w53-wwxv

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.