Replies: 2 comments
-
I don't think there is a realistic threat here. The risk of guessing a valid session ID (which is created with randomUUID) is effectively nil, and just as unlikely whether it's signed or not, given the same ID length |
Beta Was this translation helpful? Give feedback.
-
Just to add a follow-up note — here’s another reason why I think it would be beneficial to support this feature. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Body
Summary
Allow signing of the session ID before storing it in the cookie for improved security.
Background & Motivation
Other frameworks I’m using — such as Remix (@remix-run/node) and Fastify (@fastify/session with @fastify/cookie) — sign the session ID using HMAC.
In the case of Remix, it internally uses the cookie-signature library.
I'm not a security expert, but I asked ChatGPT about this topic, and based on its response, using a signed session ID appears to be a better practice. Here's a comparison it provided:
From this, it seems that allowing the session ID to be signed would improve security.
Goals
Beta Was this translation helpful? Give feedback.
All reactions