Skip to content

Incorrect default cookie name and recommendation

Low severity GitHub Reviewed Published Oct 8, 2022 in Psifi-Solutions/csrf-csrf • Updated Jan 9, 2023

Package

npm csrf-csrf (npm)

Affected versions

< 2.2.1

Patched versions

2.2.1

Description

Impact

What kind of vulnerability is it? Who is impacted?

The default cookie name (and documentation recommendation) was prefixed with Host__ instead of __Host-. The point of this prefix is for additional security, to ensure that, when no domain option is provided in the cookie options, we can guarantee the cookie came from the correct domain.

Patches

Has the problem been patched? What versions should users upgrade to?

Yes, the problem is patched from version 2.2.1, this will not be back ported, but you can use the workaround described below.

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading?

You can work around this by providing a custom cookieName as part of the options, which is correctly prefixed with __Host-.

References

Are there any links users can visit to find out more?

https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#cookie-with-__host-prefix

For more information

If you have any questions or comments about this advisory:

References

@psibean psibean published to Psifi-Solutions/csrf-csrf Oct 8, 2022
Published to the GitHub Advisory Database Oct 10, 2022
Reviewed Oct 10, 2022
Last updated Jan 9, 2023

Severity

Low

Weaknesses

No CWEs

CVE ID

No known CVE

GHSA ID

GHSA-jjmg-x456-w976
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.