Skip to content

Upgrade redis-session-store to improve performance and security#8253

Merged
mitchellhenke merged 11 commits intomainfrom
mitchellhenke/redis-session-store-exists
Apr 26, 2023
Merged

Upgrade redis-session-store to improve performance and security#8253
mitchellhenke merged 11 commits intomainfrom
mitchellhenke/redis-session-store-exists

Conversation

@mitchellhenke
Copy link
Contributor

@mitchellhenke mitchellhenke commented Apr 20, 2023

🛠 Summary of changes

This PR pulls in the changes from 18F/redis-session-store#9 and 18F/redis-session-store#10. The description in the first PR contains a fuller list of the changes as well as a couple small benchmarks against the IDP

The significant change in this upgrade is the migration of session identifiers to more fully address the vulnerability described in GHSA-hrqr-hxpp-chr3. We mitigate the vulnerability in other ways currently, but this should remediate. Briefly, the idea is to use the hashed public_id (referred to as private_id) as the lookup key for the session in Redis and return the public_id for storage on client-side. The migration plan is described in this roll plan.

The session identifiers are used outside of the request cycle for the OutOfBandSessionAccessor to serve OIDC/SAML requests, so there is accommodation of the identifier migration there as well.

This is still a draft PR and should not be merged.

Comment on lines 15 to 29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the gem is basically ours now, WDYT of exposing a ttl method on it instead of having to instance_eval?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping to some day get to switching this to use expiretime (after #7776 😬) which has some limitations on Redis version, so my soft preference is to keep IDP-specific things here to avoid complexity in the gem.

@mitchellhenke mitchellhenke marked this pull request as ready for review April 21, 2023 16:36
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/redis-session-store-exists branch 6 times, most recently from 8c6bb26 to 8f903b1 Compare April 26, 2023 14:11
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/redis-session-store-exists branch from e5d1025 to 7f25be6 Compare April 26, 2023 15:47
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/redis-session-store-exists branch from bc27fc8 to 7cbb7ef Compare April 26, 2023 17:22
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/redis-session-store-exists branch from 5c991fb to f560ac9 Compare April 26, 2023 18:01
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/redis-session-store-exists branch from f560ac9 to 62ff40c Compare April 26, 2023 18:19
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/redis-session-store-exists branch from a787303 to 62ff40c Compare April 26, 2023 19:47
@mitchellhenke mitchellhenke merged commit c7b9d7d into main Apr 26, 2023
@mitchellhenke mitchellhenke deleted the mitchellhenke/redis-session-store-exists branch April 26, 2023 20:38
@jmhooper jmhooper mentioned this pull request Apr 27, 2023
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