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

Security vulnerability #92

Closed
kellym opened this issue May 21, 2010 · 5 comments
Closed

Security vulnerability #92

kellym opened this issue May 21, 2010 · 5 comments

Comments

@kellym
Copy link

kellym commented May 21, 2010

I was attempting to write my own authentication with tornado, but I have noticed that both POST and GET arguments come through with the same call, self.get_argument(). Maybe I'm a little overly paranoid, but I like my arguments to come in separately... in fact, it's highly recommended to never use a GET request to store information, yet someone could easily throw in a query string with whatever data they wanted.

I'm all fine for leaving self.get_argument(), but maybe there should be a built-in self.GET.get() and self.POST.get(), something like Django.

@csytan
Copy link

csytan commented May 21, 2010

How would this be exploited?

@garyburd
Copy link

Note that the HTTP request method (GET,POST) and the location of request parameters (query string, request body) are different concepts.

Because Tornado dispatches to different handler methods for each HTTP request method, there is no danger of an application confusing a GET request as a POST request or vice versa.

@kellym
Copy link
Author

kellym commented May 21, 2010

Although try a POST request with a query string attached to it. Both will still be on the argument list.

@garyburd
Copy link

Yes, that is by design. Most applications don't need to distinguish between parameters in the query string and the request body.

@bdarnell
Copy link
Member

Yeah, the use of different methods (RequestHandler.get vs RequestHandler.post) addresses most of the get-vs-post issues. It's true that for POSTs Tornado masks the distinction between parameters in the url and those in the body, but I can't think of a scenario in which an attacker could modify the url without also being able to modify the body. I'm going to close this bug, but please re-open it if there is some specific way in which this behavior could be abused.

This issue was closed.
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

4 participants