TRUNK-6041: Added csrf Token to user session #173
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attending to the CSRF token issue in reference application.
I think we give a session a salt and a boolean to verify if it is still valid or not.
Each time a session is created, the
SessionListener#sessionCreated(...)
is called.We use this time to append create a new salt cache if it wasn't in existence before.
Each a session is deleted, the
SessionListener#sessionDestroyed(...)
is called.We use this time to append clear the cache.
In my thinking, this would be better that creating a filter that creates a new salt every time a request is made. For a big system like OpenMRS, this would cause some delay.
Whats left to work..
In the login servlet, either in this repository or in reference application
Register a Filter
Configure a filter in the servlet-context
in forms that are worth
Issue Link: https://issues.openmrs.org/browse/TRUNK-6041
Disscussion: https://talk.openmrs.org/t/security-vulnerability-in-openmrs-2-4-0/34879/8
I am open for any kind of discussion on this. Thank you
cc @isears @ibacher @dkayiwa @sherrif10 @ (Sarah E Elder)