Cross-site Request Forgery (CSRF) Affecting apollo-server package, versions >=2.0.0 <2.25.4


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Request Forgery (CSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-APOLLOSERVER-3043107
  • published13 Oct 2022
  • disclosed12 Oct 2022
  • creditUnknown

Introduced: 12 Oct 2022

CVE NOT AVAILABLE CWE-352  (opens in a new tab)

How to fix?

Upgrade apollo-server to version 2.25.4 or higher.

Overview

apollo-server is a Production ready GraphQL Server

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) if the server uses graphql-upload and SameSite=None cookies for authentication. JS on any origin will then cause browsers to send cookie-authenticated mutations to the GraphQL server, which will be executed without checking the CORS policy first.

Workaround

Users who are unable to upgrade to the fixed version can specify uploads: false to new ApolloServer to disable the graphql-upload integration and protect against CSRF mutations, given that the uploads feature is not used. The server will still be vulnerable to non-mutation CSRF attacks, such as timing attacks against query operations; Users need to upgrade to the fixed version and enable CSRF prevention to protect against these attacks

CVSS Scores

version 3.1