Skip to content

Remove unnecessary cookie signing secrets - #253

Open
david-crespo wants to merge 1 commit into
mainfrom
remove-cookie-secrets
Open

Remove unnecessary cookie signing secrets#253
david-crespo wants to merge 1 commit into
mainfrom
remove-cookie-secrets

Conversation

@david-crespo

Copy link
Copy Markdown
Contributor

These auxiliary cookies for returnTo and inline comments have hardcoded secrets, which are pointless. Adding real secrets for them is pointless because forging the cookies can't get an attacker anything.

https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies

The session cookie has a proper secret.

export const sessionStorage = createCookieSessionStorage({
cookie: {
name: '_session',
sameSite: 'lax', // this helps with CSRF
path: '/', // remember to add this so the cookie will work in all routes
httpOnly: true,
secrets: getSecrets(),
secure: process.env.NODE_ENV === 'production',
maxAge: sessionMaxAge(),
},
})

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rfd-site Ready Ready Preview Aug 17, 2026 7:23pm

Request Review

@david-crespo
david-crespo requested a review from notpeter August 17, 2026 19:23
@david-crespo

Copy link
Copy Markdown
Contributor Author

Heh, it occurs to me this will break any existing inline comments cookies, which last a year (unlike returnTo, which it would be fine to break).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants