fix(deps): update dependency @apollo/server to v4.9.3 [security] #114
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:
4.6.0
->4.9.3
GitHub Vulnerability Alerts
GHSA-j5g3-5c8r-7qfx
Impact
What kind of vulnerability is it?
Apollo Server can log sensitive information (Studio API keys) if they are passed incorrectly (with leading/trailing whitespace) or if they have any characters that are invalid as part of a header value.
Who is impacted?
Users who (all of the below):
node-fetch
) or configured their ownnode-fetch
fetcherThe following node snippet can test whether your API key has invalid header values. This code is taken directly from
node-fetch@2
's header value validation code.If the provided API key is not a valid header value, whenever Apollo Server uses that API key in a request (to Studio, for example),
node-fetch
will throw an error which contains the header value. This error is logged in various ways depending on the user's configuration, but most likely the console or some configured logging service.Patches
This problem is patched in the latest version of Apollo Server as soon as this advisory is published.
Workarounds
fetcher
Solution
.trim()
on incoming API keys in order to eliminate leading/trailing whitespace and log a warning when it does so.node-fetch@2
performs on header values on startup. Apollo Server will throw an error on startup (i.e., fail to start completely) and notify the user their API key is invalid along with the offending characters.Release Notes
apollographql/apollo-server (@apollo/server)
v4.9.3
Compare Source
Patch Changes
a1c725eaf
Thanks @trevor-scheer! - Ensure API keys are valid header values on startupApollo Server previously performed no sanitization or validation of API keys on startup. In the case that an API key was provided which contained characters that are invalid as header values, Apollo Server could inadvertently log the API key in cleartext.
This only affected users who:
node-fetch
fetcherApollo Server now trims whitespace from API keys and validates that they are valid header values. If an invalid API key is provided, Apollo Server will throw an error on startup.
For more details, see the security advisory:
GHSA-j5g3-5c8r-7qfx
v4.9.2
Compare Source
Patch Changes
#7699
62e7d940d
Thanks @trevor-scheer! - Fix error path attachment for list itemsPreviously, when errors occurred while resolving a list item, the trace builder would fail to place the error at the correct path and just default to the root node with a warning message:
This change places these errors at their correct paths and removes the log.
v4.9.1
Compare Source
Patch Changes
ebfde0007
Thanks @trevor-scheer! - Add missingnonce
onscript
tag for non-embedded landing pagev4.9.0
Compare Source
Minor Changes
#7617
4ff81ca50
Thanks @trevor-scheer! - Introduce newApolloServerPluginSubscriptionCallback
plugin. This plugin implements the subscription callback protocol which is used by Apollo Router. This feature implements subscriptions over HTTP via a callback URL which Apollo Router registers with Apollo Server. This feature is currently in preview and is subject to change.You can enable callback subscriptions like so:
Note that there is currently no tracing or metrics mechanism in place for callback subscriptions. Additionally, this plugin "intercepts" callback subscription requests and bypasses some of Apollo Server's internals. The result of this is that certain plugin hooks (notably
executionDidStart
andwillResolveField
) will not be called when handling callback subscription requests or when sending subscription events.For more information on the subscription callback protocol, visit the docs:
https://www.apollographql.com/docs/router/executing-operations/subscription-callback-protocol/
Patch Changes
4784f46fb
Thanks @renovate! - Update graphql-http dependencyv4.8.1
Compare Source
Patch Changes
42fc65cb2
Thanks @trevor-scheer! - Update test suite for compatibility with Node v20v4.8.0
Compare Source
Minor Changes
#7634
f8a8ea08f
Thanks @dfperry5! - Updating the ApolloServer constructor to take in a stringifyResult function that will allow a consumer to pass in a function that formats the result of an http query.Usage:
v4.7.5
Compare Source
Patch Changes
#7614
4fadf3ddc
Thanks @Cellule! - Publish TypeScript typings for CommonJS modules output.This allows TypeScript projects that use CommonJS modules with
moduleResolution: "node16"
ormoduleResolution: "nodeNext"
to correctly resolves the typings of apollo's packages as CommonJS instead of ESM.
Updated dependencies [
4fadf3ddc
]:v4.7.4
Compare Source
Patch Changes
0adaf80d1
Thanks @trevor-scheer! - Address Content Security Policy issuesThe previous implementation of CSP nonces within the landing pages did not take full advantage of the security benefit of using them. Nonces should only be used once per request, whereas Apollo Server was generating one nonce and reusing it for the lifetime of the instance. The reuse of nonces degrades the security benefit of using them but does not pose a security risk on its own. The CSP provides a defense-in-depth measure against a potential XSS, so in the absence of a known XSS vulnerability there is likely no risk to the user.
The mentioned fix also coincidentally addresses an issue with using crypto functions on startup within Cloudflare Workers. Crypto functions are now called during requests only, which resolves the error that Cloudflare Workers were facing. A recent change introduced a
precomputedNonce
configuration option to mitigate this issue, but it was an incorrect approach given the nature of CSP nonces. This configuration option is now deprecated and should not be used for any reason since it suffers from the previously mentioned issue of reusing nonces.Additionally, this change adds other applicable CSPs for the scripts, styles, images, manifest, and iframes that the landing pages load.
A final consequence of this change is an extension of the
renderLandingPage
plugin hook. This hook can now return an object with anhtml
property which returns aPromise<string>
in addition to astring
(which was the only option before).v4.7.3
Compare Source
Patch Changes
#7601
75b668d9e
Thanks @trevor-scheer! - Provide a new configuration option for landing page pluginsprecomputedNonce
which allows users to provide a nonce and avoid calling intouuid
functions on startup. This is useful for Cloudflare Workers where random number generation is not available on startup (only during requests). Unless you are using Cloudflare Workers, you can ignore this change.The example below assumes you've provided a
PRECOMPUTED_NONCE
variable in yourwrangler.toml
file.Example usage:
v4.7.2
Compare Source
Patch Changes
c3f04d050
Thanks @trevor-scheer! - Update@apollo/utils.usagereporting
dependency. Previously, installing@apollo/gateway
and@apollo/server
could result in duplicate / differently versioned installs of@apollo/usage-reporting-protobuf
. This is because the@apollo/server-gateway-interface
package was updated to use the latest protobuf, but the@apollo/utils.usagereporting
package was not. After this change, users should always end up with a single install of the protobuf package when installing both@apollo/server
and@apollo/gateway
latest versions.v4.7.1
Compare Source
Patch Changes
5d3c45be9
Thanks @mayakoneval! - 🐛 Bug Fix for Apollo Server Landing Pages on Safari. A Content Security Policy was added to our landing page html so that Safari can run the inline scripts we use to call the Embedded Sandbox & Explorer.v4.7.0
Compare Source
Minor Changes
#7504
22a5be934
Thanks @mayakoneval! - In the Apollo Server Landing Page Local config, you can now opt out of the telemetry that Apollo Studio runs in theembedded Sandbox & Explorer landing pages. This telemetry includes Google Analytics for event tracking and
Sentry for error tracking.
Example of the new config option:
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 this update again.
This PR was generated by Mend Renovate. View the repository job log.