tornado icon indicating copy to clipboard operation
tornado copied to clipboard

wsgi: Uncaught exception

Open mjofwh opened this issue 4 years ago • 2 comments

when i send a request like this:HTTPServerRequest(protocol='https', host=': localhost', method='GET', uri='/', version='HTTP/1.1', remote_ip='127.0.0.1') there is a exception as follow:

ERROR:tornado.application:Uncaught exception Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/tornado/http1connection.py", line 273, in _read_message delegate.finish() File "/usr/local/lib/python3.8/site-packages/tornado/httpserver.py", line 280, in finish self.request_callback(self.request) File "/usr/local/lib/python3.8/site-packages/tornado/wsgi.py", line 114, in call WSGIContainer.environ(request), start_response File ERROR:tornado.application:Uncaught exception Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/tornado/http1connection.py", line 273, in _read_message delegate.finish() File "/usr/local/lib/python3.8/site-packages/tornado/httpserver.py", line 280, in finish self.request_callback(self.request) File "/usr/local/lib/python3.8/site-packages/tornado/wsgi.py", line 114, in call WSGIContainer.environ(request), start_response File "/usr/local/lib/python3.8/site-packages/tornado/wsgi.py", line 154, in environ port = int(hostport[1]) ValueError: invalid literal for int() with base 10: ' localhost' /wsgi.py", line 154, in environ port = int(hostport[1]) ValueError: invalid literal for int() with base 10: ' localhost'

mjofwh avatar Aug 31 '21 02:08 mjofwh

host=': localhost' is not valid. Where is this coming from?

bdarnell avatar Sep 01 '21 00:09 bdarnell

I am using a fuzz tool to test the web application,the tool sends a packet with host=': localhost'. In fact,it can fill host with any string. @bdarnell

mjofwh avatar Sep 01 '21 08:09 mjofwh