{"cve":"CVE-2024-31999","nvd":{"published":"2024-04-10T22:15:07.710","modified":"2026-06-17T07:29:05.797","status":"Deferred","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.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","score":7.4},"cwes":["CWE-613"],"references":["https://github.com/fastify/fastify-secure-session/commit/56d66642ecc633cff0606927601e81cdac361370","https://github.com/fastify/fastify-secure-session/security/advisories/GHSA-9wwp-q7wq-jx35","https://github.com/fastify/fastify-secure-session/commit/56d66642ecc633cff0606927601e81cdac361370","https://github.com/fastify/fastify-secure-session/security/advisories/GHSA-9wwp-q7wq-jx35"],"products":[],"source":"nvd","synced_at":"2026-10-19T21:48:32.179249784+00:00"},"epss":{"cve":"CVE-2024-31999","score":0.00617,"percentile":0.49575,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-9wwp-q7wq-jx35","url":"https://osv.dev/vulnerability/GHSA-9wwp-q7wq-jx35","summary":"@fastify/secure-session: Reuse of destroyed secure session cookie","modified":"2026-09-10T03:50:11.205996194Z","packages":[{"ecosystem":"npm","name":"@fastify/secure-session","purl":"pkg:npm/%40fastify/secure-session","ranges":["<7.3.0"],"fixed":["7.3.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}