{"id":4375466,"name":"@fastify/csrf-protection","ecosystem":"npm","description":"A plugin for adding CSRF protection to Fastify.","homepage":"https://github.com/fastify/csrf-protection#readme","licenses":"MIT","normalized_licenses":["MIT"],"repository_url":"https://github.com/fastify/csrf-protection","keywords_array":[],"namespace":"fastify","versions_count":19,"first_release_published_at":"2022-05-13T13:31:02.428Z","latest_release_published_at":"2026-08-02T10:27:37.495Z","latest_release_number":"8.0.1","last_synced_at":"2026-10-07T16:05:05.854Z","created_at":"2022-05-24T13:29:18.680Z","updated_at":"2026-10-07T16:05:51.103Z","registry_url":"https://www.npmjs.com/package/@fastify/csrf-protection","install_command":"npm install @fastify/csrf-protection","documentation_url":null,"metadata":{"funding":[{"url":"https://github.com/sponsors/fastify","type":"github"},{"url":"https://opencollective.com/fastify","type":"opencollective"}],"dist-tags":{"four":"4.1.0","next":"7.0.0","latest":"8.0.1"},"contentPolicy":null},"repo_metadata":{"id":36976898,"uuid":"164392385","full_name":"fastify/csrf-protection","owner":"fastify","description":"A fastify csrf plugin","archived":false,"fork":false,"pushed_at":"2026-08-05T04:44:06.000Z","size":254,"stargazers_count":172,"open_issues_count":1,"forks_count":20,"subscribers_count":11,"default_branch":"main","last_synced_at":"2026-09-08T08:52:59.311Z","etag":null,"topics":["csrf","csrf-protection","fastify","fastify-plugin"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@fastify/csrf-protection","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null},"funding":{"github":"fastify","open_collective":"fastify"}},"created_at":"2019-01-07T07:09:39.000Z","updated_at":"2026-08-26T17:45:51.000Z","dependencies_parsed_at":"2026-08-05T19:40:29.325Z","dependency_job_id":"d525da88-7472-4b79-a5b1-8238cb34367c","html_url":"https://github.com/fastify/csrf-protection","commit_stats":{"total_commits":205,"total_committers":30,"mean_commits":6.833333333333333,"dds":0.6682926829268292,"last_synced_commit":"680c1fce1d67e987acdbd22413fe2970562ce8dc"},"previous_names":["fastify/fastify-csrf","tarang11/fastify-csrf"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/fastify/csrf-protection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastify","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":341189360,"owners_count":37509739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-22T15:14:58.755Z","status":"online","status_checked_at":"2026-09-19T02:00:07.094Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"},"owner_record":{"login":"fastify","name":"Fastify","uuid":"24939410","kind":"organization","description":"Fast and low overhead web framework, for Node.js","email":"hello@fastify.dev","website":"https://fastify.dev","location":"United States of America","twitter":"fastifyjs","company":null,"icon_url":"https://avatars.githubusercontent.com/u/24939410?v=4","repositories_count":140,"last_synced_at":"2026-10-03T03:51:58.312Z","metadata":{"has_sponsors_listing":true,"funding":{"github":"fastify","open_collective":"fastify"}},"html_url":"https://github.com/fastify","funding_links":["https://github.com/sponsors/fastify","https://opencollective.com/fastify"],"total_stars":64055,"followers":1286,"following":0,"created_at":"2022-11-02T16:30:46.974Z","updated_at":"2026-10-03T03:51:58.348Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastify","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastify/repositories"},"tags":[{"name":"v8.0.1","sha":"7aa3028e6daaa2e4faf1008712c976822ef48802","kind":"commit","published_at":"2026-08-02T10:27:38.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v8.0.1","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v8.0.1","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v8.0.1","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v8.0.1","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v8.0.1/manifests"},{"name":"v8.0.0","sha":"7afe60cea586f6396e272a0ce1b53f7ea64ca04c","kind":"tag","published_at":"2026-06-09T12:14:30.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v8.0.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v8.0.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v8.0.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v8.0.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v8.0.0/manifests"},{"name":"v7.1.0","sha":"742990de4d95c443c8dcb9ee5e69c4ac46d97712","kind":"commit","published_at":"2025-03-25T20:30:41.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v7.1.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v7.1.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v7.1.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v7.1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v7.1.0/manifests"},{"name":"v7.0.2","sha":"b2d9892007982fbe2cbd2cd06ccf514d8acf94c5","kind":"tag","published_at":"2025-01-05T11:31:37.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v7.0.2","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v7.0.2","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v7.0.2","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v7.0.2","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v7.0.2/manifests"},{"name":"v7.0.1","sha":"680c1fce1d67e987acdbd22413fe2970562ce8dc","kind":"commit","published_at":"2024-09-22T08:51:29.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v7.0.1","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v7.0.1","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v7.0.1","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v7.0.1","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v7.0.1/manifests"},{"name":"v7.0.0","sha":"f058452e21ea0baaf28de1ebeacdc06c9d6bd564","kind":"commit","published_at":"2024-09-05T14:51:38.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v7.0.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v7.0.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v7.0.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v7.0.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v7.0.0/manifests"},{"name":"v6.4.1","sha":"43c02f4223edaa2c1ef934cbb51026e0b29063cb","kind":"commit","published_at":"2023-11-06T18:38:21.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v6.4.1","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v6.4.1","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v6.4.1","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.4.1","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.4.1/manifests"},{"name":"v6.4.0","sha":"9ea1ffaa9317436cae407bfc17507d1c4412bb86","kind":"commit","published_at":"2023-10-29T14:48:09.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v6.4.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v6.4.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v6.4.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.4.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.4.0/manifests"},{"name":"v4.1.0","sha":"42a4f1cec962cc791f33bb190678a3ce4ebce226","kind":"commit","published_at":"2023-04-20T08:31:26.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v4.1.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v4.1.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v4.1.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v4.1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v4.1.0/manifests"},{"name":"v6.3.0","sha":"e746cf735e926330b803112eb439635bb8693c74","kind":"commit","published_at":"2023-04-20T08:29:52.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v6.3.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v6.3.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v6.3.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.3.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.3.0/manifests"},{"name":"v6.2.0","sha":"ea4a2cc7f144eae2e6018e79654900f2e74f5c36","kind":"commit","published_at":"2023-03-03T11:59:42.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v6.2.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v6.2.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v6.2.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.2.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.2.0/manifests"},{"name":"v6.1.0","sha":"1fde15d894e395c9fcd42af920db2f2ca668d81a","kind":"commit","published_at":"2022-12-02T07:11:44.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v6.1.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v6.1.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v6.1.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.1.0/manifests"},{"name":"v6.0.0","sha":"e18c34b90102e5d09f831ddd462fbf748cc76a3d","kind":"commit","published_at":"2022-09-26T06:50:57.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v6.0.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v6.0.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v6.0.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.0.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v6.0.0/manifests"},{"name":"v5.1.0","sha":"fc0fcb14fdbb4e85c91a782138c112fe941476dc","kind":"commit","published_at":"2022-07-11T08:10:31.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v5.1.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v5.1.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v5.1.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v5.1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v5.1.0/manifests"},{"name":"v4.0.1","sha":"7534c83364d846f4a2755fb10a9be5ba6af146ec","kind":"tag","published_at":"2022-05-17T22:36:28.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v4.0.1","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v4.0.1","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v4.0.1","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v4.0.1","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v4.0.1/manifests"},{"name":"v5.0.0","sha":"ff62a22164dd3d9c352437ce58a0685619e774d1","kind":"tag","published_at":"2022-05-17T22:36:23.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v5.0.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v5.0.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v5.0.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v5.0.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v5.0.0/manifests"},{"name":"v4.0.0","sha":"423e57cd4dd7c7ef591a09e015d37941133b20c4","kind":"commit","published_at":"2022-05-13T13:30:46.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v4.0.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v4.0.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v4.0.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v4.0.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v4.0.0/manifests"},{"name":"v3.1.0","sha":"04d05fb613817cb8c723893c241820e1633881a4","kind":"commit","published_at":"2021-05-13T09:38:10.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v3.1.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v3.1.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v3.1.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v3.1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v3.1.0/manifests"},{"name":"v3.0.1","sha":"b1c24d5ab3297b7a2db121125a6a2b8a03a29380","kind":"commit","published_at":"2020-12-29T14:59:45.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v3.0.1","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v3.0.1","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v3.0.1","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v3.0.1","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v3.0.1/manifests"},{"name":"v3.0.0","sha":"bac8c852403ab66965d4e66c0d07324873960c26","kind":"commit","published_at":"2020-12-11T12:25:44.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v3.0.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v3.0.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v3.0.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v3.0.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v3.0.0/manifests"},{"name":"v2.0.0","sha":"e1f3f92db7b3b9f52af232a39a4e00dcbd8bb9a5","kind":"commit","published_at":"2020-10-11T16:17:59.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v2.0.0","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v2.0.0","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v2.0.0","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v2.0.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v2.0.0/manifests"},{"name":"v1.0.4","sha":"e638364deb17ba2882bfd1a71ef12a0a51aa5cf2","kind":"commit","published_at":"2020-10-10T12:45:17.000Z","download_url":"https://codeload.github.com/fastify/csrf-protection/tar.gz/v1.0.4","html_url":"https://github.com/fastify/csrf-protection/releases/tag/v1.0.4","dependencies_parsed_at":null,"dependency_job_id":null,"purl":"pkg:github/fastify/csrf-protection@v1.0.4","tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v1.0.4","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/tags/v1.0.4/manifests"}]},"repo_metadata_updated_at":"2026-10-07T16:05:51.102Z","dependent_packages_count":8,"downloads":495506,"downloads_period":"last-month","dependent_repos_count":18,"rankings":{"downloads":0.918517437290876,"dependent_repos_count":2.858210763768664,"dependent_packages_count":2.4807435830423943,"stargazers_count":4.71060203459011,"forks_count":5.631326094257751,"docker_downloads_count":1.7864376262687935,"average":3.0643062565364314},"purl":"pkg:npm/%40fastify/csrf-protection","advisories":[{"uuid":"GSA_kwCzR0hTQS1xcmdmLTlncGMtdnJ4d84AAy5b","url":"https://github.com/advisories/GHSA-qrgf-9gpc-vrxw","title":"Bypass of CSRF protection in the presence of predictable userInfo","description":"## Description\nThe [CSRF](https://owasp.org/www-community/attacks/csrf) protection enforced by the `@fastify/csrf-protection` library in combination with `@fastify/cookie` can be bypassed from network and same-site attackers under certain conditions.\n\n`@fastify/csrf-protection` supports an optional `userInfo` parameter that binds the CSRF token to the user. This parameter has been introduced to prevent cookie-tossing attacks as a fix for [CVE-2021-29624](https://www.cvedetails.com/cve/CVE-2021-29624). Whenever `userInfo` parameter is missing, or its value can be predicted for the target user account, network and [same-site](https://canitakeyoursubdomain.name/) attackers can 1. fixate a `_csrf` cookie in the victim's browser, and 2. forge CSRF tokens that are valid for the victim's session. This allows attackers to bypass the CSRF protection mechanism.\n\nAs a fix, `@fastify/csrf-protection` starting from version 6.3.0 (and v4.1.0) includes a server-defined secret `hmacKey` that cryptographically binds the CSRF token to the value of the `_csrf` cookie and the `userInfo` parameter, making tokens non-spoofable by attackers. This protection is effective as long as the `userInfo` parameter is unique for each user.\n\n### Patches\n\nThis is patched in version 6.3.0 and v4.1.0.\n\n### Workarounds\n\nAs a workaround, developers can use a random, non-predictable `userInfo` parameter for each user.\n\n## Credits\n* Pedro Adão (@pedromigueladao), [Instituto Superior Técnico, University of Lisbon](https://tecnico.ulisboa.pt/)\n* Marco Squarcina (@lavish), [Security \u0026 Privacy Research Unit, TU Wien](https://secpriv.wien/)","origin":"UNSPECIFIED","severity":"MODERATE","published_at":"2023-04-20T21:18:51.000Z","withdrawn_at":null,"classification":"GENERAL","cvss_score":5.3,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","references":["https://github.com/fastify/csrf-protection/security/advisories/GHSA-qrgf-9gpc-vrxw","https://github.com/fastify/csrf-protection/security/advisories/GHSA-rc4q-9m69-gqp8","https://nvd.nist.gov/vuln/detail/CVE-2023-27495","https://github.com/fastify/csrf-protection/commit/be3e5761f37aa05c7c1ac8ed44499c51ecec8058","https://github.com/fastify/csrf-protection/releases/tag/v4.1.0","https://github.com/fastify/csrf-protection/releases/tag/v6.3.0","https://www.cvedetails.com/cve/CVE-2021-29624","https://github.com/advisories/GHSA-qrgf-9gpc-vrxw"],"source_kind":"github","identifiers":["GHSA-qrgf-9gpc-vrxw","CVE-2023-27495"],"repository_url":"https://github.com/fastify/csrf-protection","blast_radius":0.0,"created_at":"2023-04-20T22:03:22.067Z","updated_at":"2026-09-30T09:15:28.364Z","epss_percentage":0.00331,"epss_percentile":0.23522,"api_url":"https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1xcmdmLTlncGMtdnJ4d84AAy5b","html_url":"https://advisories.ecosyste.ms/advisories/GSA_kwCzR0hTQS1xcmdmLTlncGMtdnJ4d84AAy5b","packages":[{"ecosystem":"npm","package_name":"@fastify/csrf-protection","versions":[{"first_patched_version":"6.3.0","vulnerable_version_range":"\u003e= 5.0.0, \u003c 6.3.0"},{"first_patched_version":"4.1.0","vulnerable_version_range":"\u003c 4.1.0"}],"purl":"pkg:npm/%40fastify%2Fcsrf-protection"}],"related_packages_url":"https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1xcmdmLTlncGMtdnJ4d84AAy5b/related_packages","related_advisories":[]}],"docker_usage_url":"https://docker.ecosyste.ms/usage/npm/@fastify/csrf-protection","docker_dependents_count":3,"docker_downloads_count":2362,"usage_url":"https://repos.ecosyste.ms/usage/npm/@fastify/csrf-protection","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/npm/@fastify/csrf-protection/dependencies","status":null,"funding_links":["https://github.com/sponsors/fastify","https://opencollective.com/fastify"],"critical":null,"issue_metadata":{"last_synced_at":"2026-10-07T16:05:21.418Z","issues_count":32,"pull_requests_count":237,"avg_time_to_close_issue":6054137.096774193,"avg_time_to_close_pull_request":254225.89519650655,"issues_closed_count":31,"pull_requests_closed_count":229,"pull_request_authors_count":32,"issue_authors_count":25,"avg_comments_per_issue":3.09375,"avg_comments_per_pull_request":0.8523206751054853,"merged_pull_requests_count":211,"bot_issues_count":0,"bot_pull_requests_count":109,"past_year_issues_count":0,"past_year_pull_requests_count":27,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":374628.44444444444,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":27,"past_year_pull_request_authors_count":5,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":1.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":14,"past_year_merged_pull_requests_count":23,"issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcsrf-protection/issues","maintainers":[{"login":"Fdawgs","count":68,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/Fdawgs"},{"login":"mcollina","count":9,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/mcollina"},{"login":"salmanm","count":4,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/salmanm"},{"login":"jsumners","count":3,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/jsumners"},{"login":"Tony133","count":3,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/Tony133"},{"login":"marco-ippolito","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/marco-ippolito"},{"login":"gurgunday","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/gurgunday"},{"login":"Eomm","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/Eomm"},{"login":"climba03003","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/climba03003"},{"login":"dancastillo","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/dancastillo"},{"login":"delvedor","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/delvedor"},{"login":"ilteoood","count":1,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/ilteoood"}],"active_maintainers":[{"login":"Fdawgs","count":8,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/Fdawgs"},{"login":"Tony133","count":3,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/Tony133"},{"login":"climba03003","count":1,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/climba03003"}]},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/@fastify%2Fcsrf-protection/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/@fastify%2Fcsrf-protection/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/@fastify%2Fcsrf-protection/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/@fastify%2Fcsrf-protection/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/@fastify%2Fcsrf-protection/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/@fastify%2Fcsrf-protection/codemeta","maintainers":[{"uuid":"matteo.collina","login":"matteo.collina","name":null,"email":"hello@matteocollina.com","url":null,"packages_count":628,"html_url":"https://www.npmjs.com/~matteo.collina","role":null,"created_at":"2026-10-07T16:05:02.671Z","updated_at":"2026-10-07T16:05:02.671Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/npmjs.org/maintainers/matteo.collina/packages"},{"uuid":"eomm","login":"eomm","name":null,"email":"behemoth89@gmail.com","url":null,"packages_count":144,"html_url":"https://www.npmjs.com/~eomm","role":null,"created_at":"2022-11-15T17:45:17.978Z","updated_at":"2022-11-15T17:45:17.978Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/npmjs.org/maintainers/eomm/packages"},{"uuid":"tony133","login":"tony133","name":null,"email":"a.tripodi133@gmail.com","url":null,"packages_count":75,"html_url":"https://www.npmjs.com/~tony133","role":null,"created_at":"2026-03-09T09:04:27.057Z","updated_at":"2026-03-09T09:04:27.057Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/npmjs.org/maintainers/tony133/packages"}]}