express-openid-connect icon indicating copy to clipboard operation
express-openid-connect copied to clipboard

Encrypt session when using custom session stores

Open BitPatty opened this issue 2 years ago • 3 comments

Describe the problem you'd like to have solved

When using a custom session store, sensitive user information may be stored in plaintext. The application should not have direct access to this information outside the context of a request.

Describe the ideal solution

The library should allow for encrypted sessions with a per-session generated secret and/or IV that is passed to the client together with the session id.

Alternatives and current work-arounds

Current work-around is to override the session.genid option to serialize both the session id and an IV and to use a custom parser in the session.store option to map it to the according session in the session store.

Additional information, if any

-

BitPatty avatar Mar 21 '22 14:03 BitPatty

Hi @BitPatty - thanks for raising this

The session store implementation is pretty lightweight at the moment and has the extensibility points for you to add this yourself should you wish to (as you described in your workaround).

I'm not against adding this as a feature in the future, and happy to look at a PR, so will leave this open as a possible enhancement.

adamjmcgrath avatar Mar 21 '22 16:03 adamjmcgrath

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

stale[bot] avatar Jul 31 '22 21:07 stale[bot]

Bump

BitPatty avatar Aug 13 '22 10:08 BitPatty

@BitPatty - we're not looking to add this ourselves so closing.

In general, we tend to use express-session as a guide for feature parity and since this isn't included in that either, we recommend you continue to use the library's extensibility points to do your workaround.

adamjmcgrath avatar Oct 19 '22 15:10 adamjmcgrath