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

Fixes CSRF when working along side sessions #1613

Merged
merged 2 commits into from
May 25, 2020

Conversation

pmlopes
Copy link
Member

@pmlopes pmlopes commented May 19, 2020

Signed-off-by: Paulo Lopes pmlopes@gmail.com

Motivation:

It was brought up to us by @xhlika that the current implementation of CSRF on the development branch of what will become 4.0.0 suffered from several security issues when working with session aware tokens. The bug was introduced with: #1465 and totally ignored the validation of the client side input but rather check what was on the session.

This PR properly fixes it by following the updated recommendations of OWASP https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#double-submit-cookie which have been updated Feb 2020 and include new checks that were not performed then and the notes provided by @xhlika on the potential attack vector.

Tests have been fixed to cover replay attacks on session mode and proper token expiration is tested.

The PR also addresses adding the SameSite policy to the cookie (which is a recently added feature to vert.x core and wasn't available at the time of #1465.

Further, it also cover validating the request origin as per the OWASP recommendations.

@pmlopes pmlopes added this to the 4.0.0 milestone May 19, 2020
@pmlopes pmlopes requested a review from vietj May 19, 2020 20:39
@pmlopes
Copy link
Member Author

pmlopes commented May 20, 2020

Logs should have a lower level otherwise they will pollute the user logs with debug information

@xhlika
Copy link

xhlika commented May 20, 2020

Hi,

Thank you for looking into it in such a short time. I am happy that my vulnerability report contributed into making this framework more secure.

Keep up the good work!

Best,

Xhelal Likaj

@pmlopes pmlopes force-pushed the issues/csrf-with-session-fix branch from 803e9b1 to f5b3464 Compare May 20, 2020 12:44
pmlopes added 2 commits May 25, 2020 09:40
…e sessions

Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
Signed-off-by: Paulo Lopes <pmlopes@gmail.com>
@pmlopes pmlopes force-pushed the issues/csrf-with-session-fix branch from f5b3464 to 41a5534 Compare May 25, 2020 07:40
@pmlopes pmlopes merged commit 2f5eb85 into master May 25, 2020
@pmlopes pmlopes deleted the issues/csrf-with-session-fix branch August 24, 2020 09:12
@abergmann
Copy link

CVE-2020-35217 was assigned to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants