GHSA-2fvv-qxrq-7jq6: Apollo server core Cross-Site Scripting Vulnerability
MODERATEGHSA-2fvv-qxrq-7jq6 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Apollo server core libraries in the npm ecosystem. The issue involves apollo-server-core vulnerable to url-based xss attack affecting ie11 on default landing page. Remediation is available by upgrading affected packages to version 3.10.1.
GHSA-2fvv-qxrq-7jq6 at a Glance
How to Fix GHSA-2fvv-qxrq-7jq6
To remediate this vulnerability, upgrade all affected Apollo server core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install apollo-server-core@3.10.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls apollo-server-core
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-2fvv-qxrq-7jq6, inspect your project dependencies using npm:
npm ls apollo-server-core
Analyze the terminal output to locate any version of Apollo server core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.10.1), your application is affected.
Note: The npm ls apollo-server-core 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Apollo server core, 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
GHSA-2fvv-qxrq-7jq6 Affected Apollo server core Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
apollo-server-core
|
npm |
≥ 3.0.0
< 3.10.1
|
3.10.1
|
References
Frequently Asked Questions
What is GHSA-2fvv-qxrq-7jq6?
Which Apollo server core versions are affected?
What version fixes GHSA-2fvv-qxrq-7jq6?
Is apollo-server-core affected?
What CWE is associated with GHSA-2fvv-qxrq-7jq6?
How can I check npm dependencies for GHSA-2fvv-qxrq-7jq6?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2fvv-qxrq-7jq6",
"modified" : "2022-08-18T18:55:01Z",
"published" : "2022-08-18T18:55:01Z",
"aliases" : [ ],
"summary" : "apollo-server-core vulnerable to URL-based XSS attack affecting IE11 on default landing page",
"details" : "### Impact\n\nThe default landing page contained HTML to display a sample `curl` command which is made visible if the full landing page bundle could not be fetched from Apollo's CDN. The server's URL is directly interpolated into this command inside the browser from `window.location.href`. On some older browsers such as IE11, this value is not URI-encoded. On such browsers, opening a malicious URL pointing at an Apollo Router could cause execution of attacker-controlled JavaScript.\n\nThis only affects Apollo Server with the [default landing page](https://www.apollographql.com/docs/apollo-server/api/plugin/landing-pages/) enabled. Old browsers visiting your server may be affected if ANY of these apply:\n- You do not pass any landing page plugin to the `plugins` option of `new ApolloServer`.\n- You pass `ApolloServerPluginLandingPageLocalDefault()` or `ApolloServerPluginLandingPageProductionDefault()` to the `plugins` option of `new ApolloServer`.\n\nBrowsers visiting your server are NOT affected if ANY of these apply:\n- You pass `ApolloServerPluginLandingPageDisabled()` to the `plugins` option of `new ApolloServer`.\n- You pass `ApolloServerPluginLandingPageGraphQLPlayground()` to the `plugins` option of `new ApolloServer`.\n- You pass a custom plugin implementing the `renderLandingPage` hook to the `plugins` option of `new ApolloServer`.\n\nThis issue was introduced in v3.0.0 when the landing page feature was added.\n\n### Patches\nTo avoid this, the sample `curl` command has been removed in release 3.10.1.\n\n### Workarounds\n\nDisabling the landing page removes the possibility of exploit:\n\n```ts\nimport { ApolloServerPluginLandingPageDisabled } from 'apollo-server-core';\n\nnew ApolloServer({\n plugins: [ApolloServerPluginLandingPageDisabled()],\n // ...\n});\n```\n\n### See also\nA similar issue exists in the landing page of Apollo Router. See the corresponding [Apollo Router security advisory](https://github.com/apollographql/router/security/advisories/GHSA-p5q6-hhww-f999).\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the Apollo Server repository](https://github.com/apollographql/apollo-server/)\n* Email us at [security@apollographql.com](mailto:security@apollographql.com)\n\n### Credits\n\nThis issue was discovered by Adrian Denkiewicz of [Doyensec](https://doyensec.com/research.html).",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "apollo-server-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.10.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/apollographql/apollo-server/security/advisories/GHSA-2fvv-qxrq-7jq6"
}, {
"type" : "WEB",
"url" : "https://github.com/apollographql/apollo-server/commit/68a439b6e3af9edc8a2480092f2d49f058be1e64"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/apollographql/apollo-server"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-08-18T18:55:01Z",
"nvd_published_at" : null
}
}