{"answers":{"affected":"2 open source packages ship an affected version, including fastify-csrf. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-29624 in the wild and no public exploit code.","fix":"Upgrade fastify-csrf to 3.1.0 or later.","what":"CVE-2021-29624 is a medium-severity vulnerability in fastify-csrf, published on 19 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-29624 and fix it if it is affected.\n\nWhat it is: CVE-2021-29624 is a medium-severity vulnerability in fastify-csrf, published on 19 May 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-29624 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- fastify-csrf (npm): affected all versions; fixed in 3.1.0\n- fastify-csrf (npm): affected all versions; fixed in 3.1.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-29624/ (Markdown: https://insights.sbomify.com/CVE-2021-29624/index.md)","id":"CVE-2021-29624","markdown":"https://insights.sbomify.com/CVE-2021-29624/index.md","name":"CVE-2021-29624","record":{"aliases":["GHSA-rc4q-9m69-gqp8"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":true,"product_category":"Fastify CSRF plugin","requires_auth":"none","summary":"Attackers can bypass CSRF protection in multi-subdomain deployments if developers fail to supply user-specific data during token generation.","user_interaction":"required","vuln_class":"csrf"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"fastify-csrf","vendor":"fastify"}],"cvss":{"score":6.5,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-352","name":"Cross-Site Request Forgery"},{"id":"CWE-565","name":"Reliance on Cookies without Validation and Integrity Checking"}],"description":"fastify-csrf is an open-source plugin helps developers protect their Fastify server against CSRF attacks. Versions of fastify-csrf prior to 3.1.0 have a \"double submit\" mechanism using cookies with an application deployed across multiple subdomains, e.g. \"heroku\"-style platform as a service. Version 3.1.0 of the fastify-csrf fixes it. the vulnerability. 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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Lack of protection against cookie tossing attacks in fastify-csrf","id":"CVE-2021-29624","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"csrf","year":"2021"},"n_packages":2,"n_references":6,"next":{"headline":"XSS in doc_link","id":"CVE-2021-29625"},"packages":[{"ecosystem":"npm","fixed":["3.1.0"],"introduced":["0"],"last_affected":[],"package":"fastify-csrf","purl":null,"source":"GHSA-rc4q-9m69-gqp8"},{"ecosystem":"npm","fixed":["3.1.0"],"introduced":["0"],"last_affected":[],"package":"fastify-csrf","purl":"pkg:npm/fastify-csrf","source":"GHSA-rc4q-9m69-gqp8"}],"prev":{"headline":"Uninitialized variable bug in Exiv2","id":"CVE-2021-29623"},"products":["fastify-csrf"],"published":"2021-05-19","related":[{"cvss_score":5.9,"headline":"Cross-site Request Forgery (CSRF)","id":"CVE-2020-28482","kev_date_added":null,"published":"2021-01-19"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["fastify"]},"summary":"Attackers can bypass CSRF protection in multi-subdomain deployments if developers fail to supply user-specific data during token generation.","url":"https://insights.sbomify.com/CVE-2021-29624/"}