Vulnerabilities in pkg:npm/@fastify/session
PACKAGECVE-2024-35220 is a HIGH (CVSS 7.4) @fastify/session reuses destroyed session cookie vulnerability (CWE-613: Insufficient Session Expiration) affecting @fastify/session libraries in the npm ecosystem. The issue involves @fastify/session reuses destroyed session cookie. Remediation is available by upgrading affected packages to version 10.9.0.
pkg:npm/@fastify/session
Vulnerability advisories affecting package pkg:npm/@fastify/session. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-pj27-2xvp-4qxg | CVE-2024-35220 | HIGH | @fastify/session reuses destroyed session cookie |
CVE-2024-35220 at a Glance
Security Impact
CVSS: 7.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N).
How to Fix CVE-2024-35220
To remediate this vulnerability, upgrade all affected @fastify/session dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @fastify/session@10.9.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @fastify/session
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-35220, inspect your project dependencies using npm:
npm ls @fastify/session
Analyze the terminal output to locate any version of @fastify/session in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.9.0), your application is affected.
Note: The npm ls @fastify/session command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". In @fastify/session, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-35220 Affected @fastify/session Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@fastify/session
|
npm |
< 10.9.0
|
10.9.0
|
References
Frequently Asked Questions
What is CVE-2024-35220?
Which @fastify/session versions are affected?
What version fixes CVE-2024-35220?
Is @fastify/session affected?
What is the CVSS score of CVE-2024-35220?
What CWE is associated with CVE-2024-35220?
How can I check npm dependencies for CVE-2024-35220?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pj27-2xvp-4qxg",
"modified" : "2024-05-22T13:26:11Z",
"published" : "2024-05-21T18:09:57Z",
"aliases" : [ "CVE-2024-35220" ],
"summary" : "@fastify/session reuses destroyed session cookie",
"details" : "### Impact\n\nWhen restoring the cookie from the session store, the `expires` field is overriden if the `maxAge` field was set.\nThis means a cookie is never correctly detected as expired and thus expired sessions are not destroyed.\n\n### Patches\n\nUpdating to v10.9.0 will solve this.\n\n### Workarounds\n\nNone\n\n### References\n\nPublicly reported at: https://github.com/fastify/session/issues/251",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@fastify/session"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "10.9.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/fastify/session/security/advisories/GHSA-pj27-2xvp-4qxg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-35220"
}, {
"type" : "WEB",
"url" : "https://github.com/fastify/session/issues/251"
}, {
"type" : "WEB",
"url" : "https://github.com/fastify/session/commit/0495ce5b534c4550f25228821db8098293439f2f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/fastify/session"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-613" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-21T18:09:57Z",
"nvd_published_at" : "2024-05-21T21:15:08Z"
}
}