-
Notifications
You must be signed in to change notification settings - Fork 33
fix(deps): update dependency apollo-server-core to v3.11.0 [security] #1763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
renovate
wants to merge
1
commit into
master
Choose a base branch
from
renovate/npm-apollo-server-core-vulnerability
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f7e7c15 to
31329f6
Compare
c3d9b83 to
d3a7cac
Compare
d3a7cac to
afe679c
Compare
afe679c to
198165c
Compare
7e02060 to
ac48f32
Compare
c598bf9 to
2371453
Compare
5ecbb18 to
ddabcf1
Compare
e00f27b to
33c2566
Compare
33c2566 to
0eb6495
Compare
0eb6495 to
732ce2b
Compare
732ce2b to
3005c38
Compare
3005c38 to
c0f7249
Compare
c0f7249 to
c89ab5c
Compare
c89ab5c to
042ea8c
Compare
042ea8c to
4abfb7a
Compare
4abfb7a to
400f89e
Compare
400f89e to
6b353a5
Compare
1f4042b to
e31ab24
Compare
e31ab24 to
665f9ea
Compare
665f9ea to
76eb771
Compare
76eb771 to
39ff8c5
Compare
4c76cec to
6069118
Compare
6069118 to
594eda5
Compare
594eda5 to
0c0130c
Compare
0c0130c to
9c9698d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.10.1->3.11.03.6.6->3.11.0GitHub Vulnerability Alerts
GHSA-8r69-3cvp-wxc3
Impact
In Apollo Server 3 and 4, the
cache-controlHTTP response header may not reflect the cache policy that should apply to an HTTP request when that HTTP request contains multiple operations using HTTP batching. This could lead to data being inappropriately cached and shared.Apollo Server allows clients to send multiple operations in a single HTTP request. The results of these operations are returned in a single HTTP response, with a single set of headers. Apollo Client Web and Apollo Kotlin both have opt-in features to use batched requests.
Apollo Server has several features relating to caching. This advisory is about the ability to set the
cache-controlresponse header based on field- and operation-specific cache hints. (It is not about the "response cache plugin".) This header can be interpreted by a reverse proxy such as a CDN in front of your server, or by a browser.In Apollo Server 2, plugins such as the cache control plugin could not control the HTTP headers of responses to batch requests. This meant that batch requests never got the
cache-controlresponse header.In Apollo Server 3 and 4, plugins can set HTTP response headers. But for batched requests, plugins essentially assemble a separate set of response headers in parallel for each operation, and then the header sets are merged together. If plugins set the same header on multiple operations, one value is chosen arbitrarily.
This meant that if a client sent a batched HTTP request with two operations with different cache policies, Apollo Server 3 and 4 would return a
cache-controlheader that only applies to one of the operations. If one operation is allowed to be cached and the other operation is not allowed to be cached, the full response including both results could still end up being cached in a CDN or other reverse proxy cache.Note that valid batched requests must be POST requests. (There's no defined format for sending batched requests over GET.) So in order for this incorrect
cache-controlheader to have a harmful effect, a cache must allow caching POST requests. This means this bug is unlikely to cause incorrect caching in browser or mobile client caches, or in many reverse proxy/CDN caches.This issue could lead to cache poisoning attacks. For example, if a client app regularly sends an operation that should not be cached due to its dependency on session-specific information in the same HTTP request as an operation that can be cached in a shared cache, an attacker could send its own version of the request to the server and manage to get the response to its request stored in the shared cache; other users would then see the response specific to the attacker for the first operation rather than the response for their own session. That said, we expect that in a system where this cache poisoning attack is feasible, normal operation would also run into the issue and users may have already disabled one of the features in order for their system to function properly.
Patches
This issue is patched in Apollo Server v3.11.0 and v4.1.0. The issue resolved differently in the two versions.
If you are using Apollo Server 3, upgrade the package you depend on (eg
apollo-serverorapollo-server-express) to v3.11.0. This will restore the Apollo Server 2 behavior where the cache control plugin never sets thecache-controlHTTP response header on batched requests. (Other cache-related features, like the response cache plugin, still function.)If you are using Apollo Server 4, upgrade
@apollo/serverto v4.1.0. This upgrade makes the response HTTP header object seen by plugins shared among all plugins processing all operations on a request, and makes the cache control plugin mergecache-controlheader values across operations in a request. (Note that if you set thecache-controlresponse header in your own plugin, Apollo Server v4.1.0's cache control plugin will not try to overwrite the value you set.)Workarounds
As a workaround, you can disable either the HTTP batching feature or the
cache-controlheader feature.To disable HTTP batching in Apollo Server 3 (v3.5.0 or newer), pass
allowBatchedHttpRequests: falsetonew ApolloServer.This is the default behavior for Apollo Server 4; in AS4, just make sure you're not passingallowBatchedHttpRequests: true. (You cannot disable batching in versions of Apollo Server 3 older than v3.5.0.)To disable the
cache-controlheader feature, addApolloServerPluginCacheControl({ calculateHttpHeaders: false })to thepluginslist innew ApolloServer().For more information
If you have any questions or comments about this advisory:
apollo-serverrepositoryGHSA-2fvv-qxrq-7jq6
Impact
The default landing page contained HTML to display a sample
curlcommand 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 fromwindow.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.This only affects Apollo Server with the default landing page enabled. Old browsers visiting your server may be affected if ANY of these apply:
pluginsoption ofnew ApolloServer.ApolloServerPluginLandingPageLocalDefault()orApolloServerPluginLandingPageProductionDefault()to thepluginsoption ofnew ApolloServer.Browsers visiting your server are NOT affected if ANY of these apply:
ApolloServerPluginLandingPageDisabled()to thepluginsoption ofnew ApolloServer.ApolloServerPluginLandingPageGraphQLPlayground()to thepluginsoption ofnew ApolloServer.renderLandingPagehook to thepluginsoption ofnew ApolloServer.This issue was introduced in v3.0.0 when the landing page feature was added.
Patches
To avoid this, the sample
curlcommand has been removed in release 3.10.1.Workarounds
Disabling the landing page removes the possibility of exploit:
See also
A similar issue exists in the landing page of Apollo Router. See the corresponding Apollo Router security advisory.
For more information
If you have any questions or comments about this advisory:
Credits
This issue was discovered by Adrian Denkiewicz of Doyensec.
Release Notes
apollographql/apollo-server (apollo-server-core)
v3.11.0Compare Source
v3.10.4Compare Source
v3.10.3Compare Source
v3.10.2Compare Source
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.