{"answers":{"affected":"2 open source packages ship an affected version, including @fastify/secure-session.","exploited":"There is no known exploitation of CVE-2024-31999 in the wild and no public exploit code.","fix":"Upgrade @fastify/secure-session to 7.3.0 or later.","what":"CVE-2024-31999 is a high-severity vulnerability in fastify-secure-session, published on 10 Apr 2024. 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-2024-31999 and fix it if it is affected.\n\nWhat it is: CVE-2024-31999 is a high-severity vulnerability in fastify-secure-session, published on 10 Apr 2024. 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-2024-31999 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @fastify/secure-session (npm): affected all versions; fixed in 7.3.0\n- @fastify/secure-session (npm): affected all versions; fixed in 7.3.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-2024-31999/ (Markdown: https://insights.sbomify.com/CVE-2024-31999/index.md)","id":"CVE-2024-31999","markdown":"https://insights.sbomify.com/CVE-2024-31999/index.md","name":"CVE-2024-31999","record":{"aliases":["GHSA-9wwp-q7wq-jx35"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["account_takeover","security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Fastify session plugin","requires_auth":"none","summary":"Attackers can reuse destroyed secure session cookies indefinitely, bypassing session expiration and potentially maintaining unauthorized access.","user_interaction":"required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":7.4,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-613","name":"DEPRECATED: Insufficient Session Expiration"}],"description":"@festify/secure-session creates a secure stateless cookie session for Fastify. At the end of the request handling, it will encrypt all data in the session with a secret key and attach the ciphertext as a cookie value with the defined cookie name. After that, the session on the server side is destroyed. When an encrypted cookie with matching session name is provided with subsequent requests, it will decrypt the ciphertext to get the data. The plugin then creates a new session with the data in the ciphertext. Thus theoretically the web instance is still accessing the data from a server-side session, but technically that session is generated solely from a user provided cookie (which is assumed to be non-craftable because it is encrypted with a secret key not known to the user). The issue exists in the session removal process. In the delete function of the code, when the session is deleted, it is marked for deletion. However, if an attacker could gain access to the cookie, they could keep using it forever. Version 7.3.0 contains a patch for the issue. As a workaround, one may include a \"last update\" field in the session, and treat \"old sessions\" as expired.","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":"@fastify/secure-session: Reuse of destroyed secure session cookie","id":"CVE-2024-31999","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"security_feature_bypass","year":"2024"},"n_packages":2,"n_references":2,"next":{"headline":"Truncated content of messages can be leaked from matrix-appservice-irc","id":"CVE-2024-32000"},"packages":[{"ecosystem":"npm","fixed":["7.3.0"],"introduced":["0"],"last_affected":[],"package":"@fastify/secure-session","purl":null,"source":"GHSA-9wwp-q7wq-jx35"},{"ecosystem":"npm","fixed":["7.3.0"],"introduced":["0"],"last_affected":[],"package":"@fastify/secure-session","purl":"pkg:npm/%40fastify/secure-session","source":"GHSA-9wwp-q7wq-jx35"}],"prev":{"headline":"CSRF security issue on CSV import in Combodo iTop","id":"CVE-2024-31998"},"products":["fastify-secure-session"],"published":"2024-04-10","related":[],"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":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-08-02","vendors":["fastify"]},"summary":"Attackers can reuse destroyed secure session cookies indefinitely, bypassing session expiration and potentially maintaining unauthorized access.","url":"https://insights.sbomify.com/CVE-2024-31999/"}