Cross-site Scripting Vulnerability in Apollo Server

apollo-server Updated 02 Oct 2025

Summary

08/11/2021
HIGH
Yes i
High
Not published

GHSA-qm7x-rc44-rrqw: Cross-site Scripting Vulnerability in GraphQL Playground (distributed by Apollo Server). Affects apollo-server across 2 version ranges.

>= 2.0.0, < 2.25.3 >= 3.0.0, < 3.4.1

Fixed in 2.25.3 or 3.4.1, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Apollo Server is an open-source GraphQL server that allows developers to build scalable and efficient GraphQL APIs. It is widely used in various JavaScript ecosystems, including Node.js and Express. However, certain configurations of Apollo Server can serve the client-side web app 'GraphQL Playground' from the same web server that executes GraphQL operations. This web app has access to cookies and other credentials associated with the web server's operations, making it vulnerable to cross-site scripting attacks.

Vulnerability Detail

The vulnerability in Apollo Server allows for arbitrary JavaScript code execution in the web server's origin. If a user clicks a specially crafted link to the GraphQL Playground page served by Apollo Server, an attacker can steal cookies and other private browser data. This vulnerability can have severe consequences if the GraphQL server's origin URL is used to store sensitive data such as cookies. The vulnerability is caused by a cross-site scripting vulnerability in GraphQL Playground itself, which is detailed in the 'graphql-playground' advisory.

How To Fix

Latest published version: 3.13.0 as of 23 Oct 2026

npm install apollo-server@3.13.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 2.0.0, < 2.25.3 2.25.3
    npm install apollo-server@2.25.3
  • >= 3.0.0, < 3.4.1 3.4.1
    npm install apollo-server@3.4.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If upgrading to the latest version of Apollo Server is challenging, a workaround is to configure the current version of Apollo Server to serve the latest version of the GraphQL Playground app. This can be done by specifying the 'version' option when configuring GraphQL Playground. The specific steps depend on the version of Apollo Server being used and the current configuration of GraphQL Playground.

Conclusion

The cross-site scripting vulnerability in Apollo Server can have severe consequences, allowing attackers to steal sensitive information from users. It is crucial to upgrade to the latest version of Apollo Server or apply the recommended workaround to mitigate the vulnerability. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for apollo-server →

Share this vulnerability

FAQ

Apollo Server is an open-source GraphQL server that allows developers to build scalable and efficient GraphQL APIs. It is widely used in various JavaScript ecosystems, including Node.js and Express.

GraphQL Playground is a client-side web app that provides a graphical interface for exploring and testing GraphQL APIs. It is often served by Apollo Server and has access to cookies and other credentials associated with the web server's operations.

The vulnerability occurs when Apollo Server serves GraphQL Playground from the same web server that executes GraphQL operations. This allows for a cross-site scripting vulnerability in GraphQL Playground, which can lead to arbitrary JavaScript code execution in the web server's origin.

The vulnerability allows an attacker to steal cookies and other private browser data from users who click on specially crafted links to the GraphQL Playground page served by Apollo Server. This can lead to unauthorized access to sensitive information and potential account hijacking.

To fix the vulnerability, it is recommended to upgrade to the latest version of Apollo Server. Upgrade the Apollo Server entry point package to one of the fixed versions, such as 'apollo-server', 'apollo-server-express', or 'apollo-server-lambda'. Additionally, if 'apollo-server-core' is directly depended upon in the 'package.json' file, make sure to upgrade it to the same version.

Related vulnerabilities

Recent vulnerabilities recorded for apollo-server.

How To Fix

Latest published version: 3.13.0 as of 23 Oct 2026

npm install apollo-server@3.13.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 2.0.0, < 2.25.3 2.25.3
    npm install apollo-server@2.25.3
  • >= 3.0.0, < 3.4.1 3.4.1
    npm install apollo-server@3.4.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback