CVE-2024-31999
JavaScript vulnerability analysis and mitigation

Overview

The vulnerability (CVE-2024-31999) affects @fastify/secure-session, a package that creates secure stateless cookie sessions for Fastify. The issue was discovered and disclosed on April 10, 2024, affecting versions prior to 7.3.0. The vulnerability relates to session management where encrypted session cookies could potentially be reused even after being marked for deletion (GitHub Advisory).

Technical details

The vulnerability stems from the session removal process in @fastify/secure-session. The package encrypts session data with a secret key and attaches it as a cookie value. When a session is deleted, it is only marked for deletion, but the encrypted cookie remains valid and could be reused. The vulnerability has been assigned a CVSS v3.1 score of 7.4 (High) with a vector string of CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N, indicating network accessibility with low attack complexity (GitHub Advisory).

Impact

If an attacker gains access to a deleted session's cookie, they could potentially reuse it indefinitely, maintaining unauthorized access to the session data. This poses a significant security risk as it could lead to session hijacking and unauthorized access to user data (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in version 7.3.0 of @fastify/secure-session. As a workaround, users can include a 'last update' field in the session and treat old sessions as expired. Additionally, it is recommended to configure cookies as 'http only' to enhance security. Users should upgrade to version 7.3.0 or later to receive the security fix (GitHub Advisory, FortiGuard Labs).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management