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

/login route should not be GET (CSRF) #315

Closed
f446843 opened this issue Sep 21, 2013 · 6 comments
Closed

/login route should not be GET (CSRF) #315

f446843 opened this issue Sep 21, 2013 · 6 comments
Labels
Milestone

Comments

@f446843
Copy link

f446843 commented Sep 21, 2013

I have a security bug found!
check out http://try.nodebb.org/topic/95/csrf-attack

@julianlam
Copy link
Member

Neat... the logout url was passed into the standard markdown image tag, causing the viewer to become logged out.

@f446843
Copy link
Author

f446843 commented Sep 21, 2013

for the attack I have used the following code:
it sends a request to the specified url http://try.nodebb.org/logout.

@f446843
Copy link
Author

f446843 commented Sep 21, 2013

the requested image should not be loaded directly via the browser. instead, should be the nodebb-server in the middle.

@f446843
Copy link
Author

f446843 commented Sep 21, 2013

alternatively, the file extension or MIME type could be examined.

@f446843
Copy link
Author

f446843 commented Sep 21, 2013

It is also interesting that you are still logged in via the socket connection, even though you are logged out via normal http.

@julianlam
Copy link
Member

Changing logout route to POST with CSRF should be enough to prevent this exploit. Any other GET routes should be examined to ensure that nothing is done, as the GET verb should only return and never modify resources.

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

No branches or pull requests

2 participants