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

RegenerateToken generates two CSRF cookies when no previous CSRF cookie was set #61

Open
aeneasr opened this issue Oct 14, 2020 · 0 comments

Comments

@aeneasr
Copy link
Contributor

aeneasr commented Oct 14, 2020

Calling RegenerateToken() in a request context where the client is not sending a CSRF cookie, two CSRF cookies will be generated:

map[Set-Cookie:[csrf_token=aZA5CKCpmzGwlyfyFZp1akOOo4dSbZEdSAziaN+nRYE=; Path=/; Domain=example.com; Max-Age=31536000; HttpOnly; Secure csrf_token=xe/JUh5YavyzQtmIqU018swoHmPN5nQsTSqSJscKJU4=; Path=/; Domain=example.com; Max-Age=31536000; HttpOnly; Secure] Vary:[Cookie]]

Depending on the order of the browser stores the cookie, this can lead to false-positive CSRF detection.

aeneasr added a commit to aeneasr/nosurf that referenced this issue Oct 14, 2020
aeneasr added a commit to aeneasr/nosurf that referenced this issue Oct 14, 2020
aeneasr added a commit to aeneasr/nosurf that referenced this issue Oct 14, 2020
aeneasr added a commit to aeneasr/nosurf that referenced this issue Oct 14, 2020
aeneasr added a commit to aeneasr/nosurf that referenced this issue Oct 14, 2020
aeneasr added a commit to ory/nosurf that referenced this issue Oct 22, 2020
aeneasr added a commit to ory/nosurf that referenced this issue Oct 22, 2020
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

1 participant