Skip to main content
← Vulnerabilities

@fastify/secure-session vulnerable to signature verification bypass via cookie signature removal

Affects @fastify/secure-session 7.5.0 up to 8.4.2 when cookie.signed is true and only the signing secret is rotated. Fixed in 8.4.2.

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

4.2MediumCNA
Exploited
No known exploitation
Fix
Fixed in 8.4.2
Who is exposed
Specific setups only

Do first: Check whether your setup matches what the bug needs. Affected versions of @fastify/secure-session from 7.5.0 up to (not including) 8.4.2 Plugin is configured with cookie.signed: true Application supplies the cookie signing secret separately from the session encryption key and rotates only the signing secret while keeping the encryption key active

Published
Last modified
Published
Not listed in CISA KEV
12/100 · provisional
Specific setups only
Fix
Fixed in 8.4.2
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: none
  • Automatable: no
  • Technical impact: partial

Summary

The @fastify/secure-session plugin for Fastify, used to store encrypted sessions in cookies when signed cookies are enabled, is affected. An attacker who already holds an old, unexpired session cookie can strip its invalidated signature and keep using that session after the signing secret has been rotated, though they cannot forge data or survive rotation of the encryption key.

Read the original description

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

What to do

  • Check whether your setup matches what the bug needs.

    Affected versions of @fastify/secure-session from 7.5.0 up to (not including) 8.4.2 Plugin is configured with cookie.signed: true Application supplies the cookie signing secret separately from the session encryption key and rotates only the signing secret while keeping the encryption key active
  • Upgrade to a fixed version: 8.4.2.

  • Workaround: Rotate the session encryption key (the first entry in the key array) to retire existing sessions, rather than relying on rotation of the signing secret alone

Timeline

  1. CVE published
  2. First seen by cve.now
  3. CISA SSVC assessment

    Exploitation: none · Automatable: no · Technical impact: partial

  4. Record last updated

Affected versions

  • @fastify/secure-session @fastify/secure-session

    From 7.5.0 · fixed in 8.4.2

Evidence 2

  1. Advisory
  2. Link

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

FAQ

Questions about CVE-2026-117549

What does this mean?

A holder of an old, unexpired session cookie can strip its now-obsolete signature and keep using the session after the signing secret has been rotated. The holder cannot forge session data or extend the session's expiry.Source: github.com

Am I affected, and how do I check?

Versions from 7.5.0 up to but not including 8.4.2 are affected, but only when the plugin is configured with cookie.signed: true and the application rotates only the signing secret while keeping the encryption key active. Check the installed version with npm ls @fastify/secure-session and look for cookie.signed: true in the plugin registration.Source: github.com

What should I do about it?

Upgrade to @fastify/secure-session 8.4.2 or later. Until then, the workaround is to rotate the session encryption key (the first entry in the key array) to retire existing sessions, rather than relying on rotation of the signing secret alone.Source: github.com

Is it being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data