@fastify/secure-session: Reuse of destroyed secure session cookieGHSA-9wwp-q7wq-jx35
HIGHFix: fastify/fastify-secure-session@56d6664GHSA-9wwp-q7wq-jx35 is a high-severity (CVSS 7.4) CWE-613 vulnerability in @fastify/secure-session. A fix is available for @fastify/secure-session — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-9wwp-q7wq-jx35.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@fastify/secure-sessionnpmDescription
Impact
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.
Patches
Fixed in 56d66642ecc633cff0606927601e81cdac361370. Update to v7.3.0.
Workarounds
Include a "last update" field in the session, and treat "old sessions" as expired. Make sure to configure your cookie as "http only".
References
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @fastify/secure-session | all versions | 7.3.0npm install @fastify/secure-session@7.3.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @fastify/secure-session, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @fastify/secure-session to 7.3.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-9wwp-q7wq-jx35 is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
Frequently Asked Questions
Is GHSA-9wwp-q7wq-jx35 in your dependencies?
Find it across npm, including transitive dependencies.