Cross-site Request Forgery (CSRF) Affecting csrf-csrf package, versions <2.2.1


Severity

Recommended
0.0
low
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-CSRFCSRF-3042410
  • published11 Oct 2022
  • disclosed10 Oct 2022
  • creditUnknown

Introduced: 10 Oct 2022

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

How to fix?

Upgrade csrf-csrf to version 2.2.1 or higher.

Overview

csrf-csrf is an utility package to help implement stateless CSRF protection using the Double Submit Cookie Pattern in express.

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) by using the default cookie name when none is provided, which is prefixed with Host__ instead of __Host-.

Workaround

This vulnerability can be avoided by setting cookieName to a safe default value.

References

CVSS Scores

version 3.1