Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: SESSION_SECRET should be private #556

Closed
binajmen opened this issue Dec 19, 2022 · 1 comment · Fixed by #578
Closed

doc: SESSION_SECRET should be private #556

binajmen opened this issue Dec 19, 2022 · 1 comment · Fixed by #578
Labels
bug Something isn't working

Comments

@binajmen
Copy link

I believe the SESSION_SECRET should not come from the public environment variables as stated in the example available at https://start.solidjs.com/advanced/session:

import { createCookieSessionStorage } from "solid-start";
 
const storage = createCookieSessionStorage({
  cookie: {
    name: "session",
    secure: import.meta.env.PROD,
    secrets: [import.meta.env.VITE_SESSION_SECRET], // <-- leak?
    sameSite: "lax",
    path: "/",
    maxAge: 60 * 60 * 24 * 30, // 30 days
    httpOnly: true
  }
});

This will leak the session secret in the client bundle according to Vite security notes.

I discussed this issue here OrJDev/create-jd-app#24 with an alternative.

@ryansolid ryansolid added the bug Something isn't working label Dec 22, 2022
@binajmen
Copy link
Author

#578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants