---
id: "CVE-2026-117549"
kind: "vulnerability"
aliases: ["CVE-2026-117549"]
title: "@fastify/secure-session: stale signed cookies still decrypt after signing secret rotation"
severity: "medium"
cvss: 4.2
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["fastify", "node.js", "package", "session-management"]
not_affected_if: ["default-config", "encryption-key-rotated-with-signing-secret", "no-signed-cookie-option"]
published_at: "2026-11-02T11:17:30+00:00"
first_seen_at: "2026-11-02T11:22:53+00:00"
updated_at: "2026-11-02T11:24:21+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-117549", "first_seen_at": "2026-11-02T11:22:53+00:00"}]
---

# @fastify/secure-session: stale signed cookies still decrypt after signing secret rotation

@fastify/secure-session, a Fastify session plugin, versions 7.5.0 through 8.4.1 decrypt a session even when its cookie signature fails validation when the signed cookie option is set. An attacker holding an old, unexpired session cookie can strip the invalid signature and keep using that session after the signing secret is rotated.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version of `@fastify/secure-session` in `package-lock.json`, `pnpm-lock.yaml` or `yarn.lock`, or with `npm ls @fastify/secure-session`.
- Look for `signed` cookie options set on the session plugin registration and whether the signing secret is rotated separately from the encryption key.

## Fix

- `@fastify/secure-session`: upgrade to `8.4.2`
- Workaround stated by the source: rotate the session encryption key rather than relying on rotation of the cookie signing secret alone.

## Timeline

- 2026-11-02T11:22:53+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-117549

## Documents

- [advisory] Vendor advisory: github.com https://github.com/fastify/fastify-secure-session/security/advisories/GHSA-4cgq-x5f7-r8jv

## From the sources

@fastify/secure-session is a session plugin for Fastify that stores an encrypted session in a cookie. In versions 7.5.0 through 8.4.1, when the plugin is configured with the signed cookie option, it calls the cookie unsign routine but, when the signature check reports the value as invalid, still passes the original cookie value to the session decoder, so a session whose signature did not validate is decrypted anyway. The practical effect appears when an application supplies the cookie signing secret independently of the session encryption key and rotates only the signing secret to retire existing sessions while keeping the encryption key active, because a holder of an old session cookie can strip the now obsolete signature and keep using the session. The attacker must already possess an unexpired encrypted session cookie and needs neither secret, and cannot forge session data, extend expiry, or survive rotation of the encryption key. The issue is fixed in @fastify/secure-session 8.4.2, which no longer decodes the session when the signed cookie option is set and the signature check fails, and users should upgrade to 8.4.2 or later. As a workaround, rotate the session encryption key rather than relying on rotation of the cookie signing secret alone.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
