nday
CVE-2024-31999 GHSA-9wwp-q7wq-jx35

@fastify/secure-session: Reuse of destroyed secure session cookie

fastify / fastify-secure-session

Disclosed . nday has no fix record for it yet; that does not mean no patch exists. None of the four PoC sources lists it. Not in CISA KEV.

why these tags

nday derives these tags by fixed rules from the facts below; NVD, the CNA and other sources do not assign them. Vocabulary and rules: ~/tags.

session management flaw
CWE-613, stated by the CNA GitHub_M and NVD, republishing [email protected]
network
AV:N in CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N (CVSS 3.1) from the CNA GitHub_M
no authentication required
PR:N in CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N (CVSS 3.1) from the CNA GitHub_M
stage
DIS
disclosed
cvss
7.4 HIGH v3.1

Lifecycle

x axis UTC; dot = exact minute, wide bar = date only, hollow = unknown or inferred.
time unknown
DISdisclosed
2024-04-10T21:59Z
PATpatch
no record yet
ANAanalysis
no record yet
POCPoC
no record yet
ITWexploited
no record yet
KEVKEV
no record yet

Summary

@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.

Original text of the CVE record (cvelist), shown as published.

Exploit conditions

What an attack needs, read from the CVSS vector.
Attack vector AV:N
Network: the attacker only needs to reach it over the network
Attack complexity AC:L
Low: no special conditions; the attacker can expect repeatable success
Privileges required PR:N
None: no account or authorization needed
User interaction UI:R
Required: a user must do something, such as open a file or click a link

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

CVSS 3.1 vector from the CVE record, scored by the CNA GitHub_M.

Event log

+DISdisclosed

CVE record published by GitHub_M. CVSS 7.4, high.

src cvelist · nday , bulk import · raw
{
  "id": 331496,
  "type": "disclosed",
  "source": "cvelist",
  "url": "https://www.cve.org/CVERecord?id=CVE-2024-31999",
  "occurred_at": "2024-04-10T21:59:54.176Z",
  "observed_at": "2026-11-13T05:38:32.49371Z",
  "is_backfill": true,
  "dedupe_key": "",
  "detail": {
    "cvss": {
      "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",
      "base_score": 7.4,
      "base_severity": "HIGH"
    },
    "ssvc": {
      "timestamp": "2024-07-31T17:54:07.860415Z",
      "automatable": "no",
      "exploitation": "none",
      "technical_impact": "partial"
    },
    "state": "PUBLISHED",
    "date_published": "2024-04-10T21:59:54.176Z",
    "assigner_short_name": "GitHub_M"
  }
}

Report an error

report an error or omission

Something on this page wrong or missing? Tell the editors; if they accept it, this page's revision log says so publicly. Upstream data is not changed.

Researcher discussion

0 researchers mentioned this in the last 7 days

Posts on X by researchers on nday's list that mention this CVE, shown as posted. nday does not check them.

nday has not collected any post on X by listed researchers that mentions this CVE.

Discussion

0 comments

No comments yet.