GHSA-jjmg-x456-w976

Suggest an improvement
Source
https://github.com/advisories/GHSA-jjmg-x456-w976
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/10/GHSA-jjmg-x456-w976/GHSA-jjmg-x456-w976.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-jjmg-x456-w976
Published
2022-10-10T20:59:02Z
Modified
2022-10-10T20:59:02Z
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:

Database specific
{
    "cwe_ids":  [],
    "github_reviewed":  true,
    "github_reviewed_at":  "2022-10-10T20:59:02Z",
    "nvd_published_at":  null,
    "severity":  "LOW"
}
References

Affected packages

npm / csrf-csrf

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.2.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/10/GHSA-jjmg-x456-w976/GHSA-jjmg-x456-w976.json"