GHSA-rc4q-9m69-gqp8

Suggest an improvement
Source
https://github.com/advisories/GHSA-rc4q-9m69-gqp8
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/05/GHSA-rc4q-9m69-gqp8/GHSA-rc4q-9m69-gqp8.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-rc4q-9m69-gqp8
Aliases
Published
2021-05-17T20:53:30Z
Modified
2026-07-08T06:28:40Z
Severity
  • 6.5 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N CVSS Calculator
Summary
Lack of protection against cookie tossing attacks in fastify-csrf
Details

Impact

Users that used fastify-csrf with the "double submit" mechanism using cookies with an application deployed across multiple subdomains, e.g. "heroku"-style platform as a service.

Patches

Version 3.1.0 of the fastify-csrf fixes it. See https://github.com/fastify/fastify-csrf/pull/51 and https://github.com/fastify/csrf/pull/2.

The user of the module would need to supply a userInfo when generating the CSRF token to fully implement the protection on their end. This is needed only for applications hosted on different subdomains.

Workarounds

None available.

References

  1. https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html
  2. https://owasp.org/www-pdf-archive/David_Johansson-Double_Defeat_of_Double-Submit_Cookie.pdf

Credits

This vulnerability was found by Xhelal Likaj xhelallikaj20@gmail.com.

For more information

If you have any questions or comments about this advisory:

Database specific
{
    "cwe_ids":  [
        "CWE-352",
        "CWE-565"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2021-05-17T20:29:48Z",
    "nvd_published_at":  "2021-05-19T22:15:00Z",
    "severity":  "MODERATE"
}
References

Affected packages

npm / fastify-csrf

Package

Affected ranges

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

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/05/GHSA-rc4q-9m69-gqp8/GHSA-rc4q-9m69-gqp8.json"