Skip to content

Switch to DELETE for /logout route to prevent CSRF #1013

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

Merged
merged 1 commit into from
Aug 26, 2017

Conversation

jtgeibel
Copy link
Member

Other sites are allowed to make GET requests so switching to DELETE
to match the destructive nature of the route.

If the user navigates to GET /logout we now fall back to the default
behavior which is to serve up the ember app. Ember then sends a
DELETE request. Fortunately we already enforce sameorigin for
iframes via the X-FRAME-OPTIONS header.

Fixes: #986

Other sites are allowed to make `GET` requests so switchig to `DELETE`
to match the destructive nature of the route.

If the user navigates to `GET /logout` we now fall back to the default
behavior which is to serve up the ember app.  Ember then sends a
`DELETE` request.  Fortunately we already enforce sameorigin for
iframes via the `X-FRAME-OPTIONS` header.

Fixes: rust-lang#986
@carols10cents
Copy link
Member

Sounds good to me!

bors: r+

bors-voyager bot added a commit that referenced this pull request Aug 26, 2017
1013: Switch to `DELETE` for /logout route to prevent CSRF r=carols10cents

Other sites are allowed to make `GET` requests so switching to `DELETE`
to match the destructive nature of the route.

If the user navigates to `GET /logout` we now fall back to the default
behavior which is to serve up the ember app.  Ember then sends a
`DELETE` request.  Fortunately we already enforce sameorigin for
iframes via the `X-FRAME-OPTIONS` header.

Fixes: #986
@bors-voyager
Copy link
Contributor

bors-voyager bot commented Aug 26, 2017

Build succeeded

@bors-voyager bors-voyager bot merged commit 9cb4c98 into rust-lang:master Aug 26, 2017
@jtgeibel jtgeibel deleted the 986-logout-csrf branch August 27, 2017 00:28
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