Update dependency com.netflix.graphql.dgs:graphql-dgs-platform-dependencies to v5 #92
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.10.4->5.0.0Release Notes
Netflix/dgs-framework
v5.0.0We are releasing a major version for DGS to address a CSRF vulnerability. This version adds a breaking change for callers that target the GraphQL Endpoint,
/graphqlby default, and don't explicit set thecontent-typeto be one of eitherapplication/json,application/graphql, ormultipart/form-data, the latter use for file upload. If a client is usingmultipart/form-datathey will now need to include a preflight header that matches any of "x-apollo-operation-name", "apollo-require-preflight", or "graphql-require-preflight".TL;DR
content-typeofapplication/json,application/graphql, andmultipart/form-data.content-typeismultipart/form-data. Acceptable preflight headers are "x-apollo-operation-name", "apollo-require-preflight", or "graphql-require-preflight"Application developers should provide a sensible CORS policy, doing so is out of scope of the DGS framework but available via Spring Boot and Spring Security.
Although not recommended you can disable the preflight check by setting
dgs.graphql.header.validation.enabledtofalse.Context
There could be a potential CSRF attacks that can leverage the execution of JS code attached to a
content-type: multipart/form-data, or other content-types which will not force the browsers to do a preflight check and enforce the CORS policy. Application developers should provide a sensible CORS policy as well as, if they use cookies, a sensible cookie SameSite policy.DGS MVC supports the execution of GraphQL operations via HTTP POST requests with
content-type: multipart/form-data. Because they are POST requests, they can contain GraphQL mutations. Because they usecontent-type: multipart/form-data, they can be "simple requests" which are not preflighted by browsers.Spring Boot applications using DGS that set
SameSite=Nonecookies for authentication are then open to JS code from any origin can that can cause browsers to sendcookie-authenticatedMutations to the GraphQL endpoint, this will then be executed without checking your CORS policy first. Although the attack won't be able to see the response to the mutation if your CORS policy is set up properly, the side effects of the mutation will still occur.In addition, if the Spring Boot application using DGS relies on network properties for security (whether by explicitly looking at the client's IP address or by only being available on a private network), then JS on any origin can cause browsers (which may be on a private network or have an allowed IP address) to send mutations to your GraphQL server, which will be executed without checking your CORS policy first. (This attack does not require your server to use cookies. It is in some cases prevented by some browsers such as Chrome.)
For additional context visit Apollo Server 2 graphql-upload CSRF Page.
⭐ Special thanks to the Apollo Server Team for identifying the CSRF. ⭐
What’s Changed
Configuration
📅 Schedule: 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 has been generated by Mend Renovate. View repository job log here.