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

Invalidating sessions after losing permissions? #36

Open
mudge opened this issue Oct 25, 2024 · 1 comment
Open

Invalidating sessions after losing permissions? #36

mudge opened this issue Oct 25, 2024 · 1 comment

Comments

@mudge
Copy link

mudge commented Oct 25, 2024

While https://thecopenhagenbook.com/sessions#session-invalidation states:

All sessions of the user should also be invalidated when they gain new permissions (email verification, new role, etc) or change passwords.

Should the same be said when a user loses permissions, e.g. disabling 2FA (including indirectly by using a recovery code), or changing role from an administrator to a lower privilege?

@alp1n3-eth
Copy link

This section could probably be updated to add a distinction between just invalidation vs. renewal, as @pilcrowonpaper references the OWASP Cheat Sheets to be used alongside it. The section says:

The session ID must be renewed or regenerated by the web application after any privilege level change within the associated user session. The most common scenario where the session ID regeneration is mandatory is during the authentication process, as the privilege level of the user changes from the unauthenticated (or anonymous) state to the authenticated state though in some cases still not yet the authorized state. Common scenarios to consider include; password changes, permission changes, or switching from a regular user role to an administrator role within the web application. For all sensitive pages of the web application, any previous session IDs must be ignored, only the current session ID must be assigned to every new request received for the protected resource, and the old or previous session ID must be destroyed.

It's located within the cheat sheet for Session Management. It looks like the usage of just session invalidation is reserved for times like session expiration (automatic), logout functionality used (manual), etc.

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

No branches or pull requests

2 participants