Advisory

GHSA-jjmg-x456-w976

Also known as: None

Summary

Incorrect default cookie name and recommendation

Details

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:

Severity

Low Basis: The source's own band: LOW

Dates

Published
2022-10-10 20:59 UTC
Modified
2022-10-10 20:59 UTC

Affected packages and fixes

csrf-csrf

npm · All systems

Affected

  • introduced 0, fixed 2.2.1 (semver)

Fixed versions

2.2.1

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences