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

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 ID SNYK-JS-APOLLOSERVER-3043107
  • published 13 Oct 2022
  • disclosed 12 Oct 2022
  • credit Unknown

Introduced: 12 Oct 2022

CVE NOT AVAILABLE CWE-352 Open this link 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
Expand this section

Snyk

Recommended
5.3 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    Required
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    None
  • Integrity (I)
    High
  • Availability (A)
    None