Vendure insecure cookie SameSite default enabling CSRF

Severity: info · Published 2023-07-11

Vendure, an e-commerce GraphQL framework, had insecure default cookie settings that left all API requests vulnerable to Cross-Site Request Forgery (CSRF) attacks. Attackers could trick authenticated users into performing unwanted actions on the platform, such as modifying orders or account settings, by exploiting the lack of SameSite protection on session cookies.

Technologies: @vendure/core (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Informational severity, published 11 July 2023.
Which products and versions are affected?
@vendure/core (npm) SEMVER:introduced=0,fixed=2.0.3.
Is there a fix for This vulnerability?
Yes. @vendure/core (npm): upgrade to 2.0.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network.
Am I affected?
Check whether you run @vendure/core (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • @vendure/core (npm): upgrade to 2.0.3 or later
    npm install @vendure/core@2.0.3

Technical details

The vulnerability is a CSRF weakness caused by the SameSite cookie attribute being set to false by default (inherited from the cookie-session npm package), which prevents browser enforcement of same-origin policies for session cookies. The affected component is the authentication cookie configuration in the Vendure core framework. Any API request from an authenticated user can be exploited via CSRF if the user visits a malicious website while authenticated to a Vendure instance. The attack requires no additional authentication or special privileges—the attacker simply sends a forged request that the victim's browser will execute with their existing session cookie. The issue was patched in version 2.0.3 by setting sameSite to 'lax' by default; administrators can also manually configure the option to 'strict' or 'lax' as a workaround.

Affected products

  • Vendure core before 2.0.3

Timeline

  • 2023-07-11: disclosed
  • 2023-07-11: patched: Version 2.0.3 released with fix

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.