You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
β question about the decisions made in the repository
π Describe the bug. What is the current behavior?
If a communication fails, cheroot will catch all exceptions and execute self._conditional_error(req, '500 Internal Server Error'). If in this code any other exception beside FatalSSLAlert and NoSSLError is raised, the worker calling communicate will die.
β What is the motivation / use case for changing the behavior?
Better exception handling
π‘ To Reproduce
no way to reproduce this by purpose
π‘ Expected behavior
Thread does not crash
π Details
SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2423)
File "cheroot/server.py", line 1267, in communicate
req.parse_request()
File "cheroot/server.py", line 702, in parse_request
success =self.read_request_line()
File "cheroot/server.py", line 761, in read_request_lineself.simple_response(
File "cheroot/server.py", line 1111, in simple_responseself.conn.wfile.write(EMPTY.join(buf))
File "cheroot/makefile.py", line 438, in write
res =super().write(val, *args, **kwargs)
File "cheroot/makefile.py", line 36, in writeself._flush_unlocked()
File "cheroot/makefile.py", line 45, in _flush_unlocked
n =self.raw.write(bytes(self._write_buf))
File "socket.py", line 724, in writereturnself._sock.send(b)
File "ssl.py", line 1210, in sendreturnself._sslobj.write(data)
SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2423)
File "cheroot/workers/threadpool.py", line 125, in run
keep_conn_open = conn.communicate()
File "cheroot/server.py", line 1296, in communicateself._conditional_error(req, '500 Internal Server Error')
File "cheroot/server.py", line 1339, in _conditional_error
req.simple_response(response)
File "cheroot/server.py", line 1111, in simple_responseself.conn.wfile.write(EMPTY.join(buf))
File "cheroot/makefile.py", line 438, in write
res =super().write(val, *args, **kwargs)
File "cheroot/makefile.py", line 36, in writeself._flush_unlocked()
File "cheroot/makefile.py", line 45, in _flush_unlocked
n =self.raw.write(bytes(self._write_buf))
File "socket.py", line 724, in writereturnself._sock.send(b)
File "ssl.py", line 1210, in sendreturnself._sslobj.write(data)
π Environment
Cheroot version: 8.4.1
Python version: 3.11.0
OS: Linux
Browser: all
The text was updated successfully, but these errors were encountered:
I am seeing this error when our Cheroot based server undergoes a Nessus scan. Attached are the exceptions encountered during the scan and a patch (taken against Cheroot 9.0.0) that at least prevents it from locking up. I am in no way suggesting that my patch is a proper fix!
A DoS would happen in many situations, including TLS errors and
attempts to close the underlying sockets erroring out.
This patch aims to prevent a situation when the worker threads are
killed by arbitrary exceptions that bubble up to their entry point
layers that aren't handled properly or at all.
PR #649Fixes#358Fixes#354
Ref #310
Ref #346
Ref #375
Ref #599
Ref #641Resolves#365
β I'm submitting a ...
π Describe the bug. What is the current behavior?
If a communication fails, cheroot will catch all exceptions and execute
self._conditional_error(req, '500 Internal Server Error')
. If in this code any other exception besideFatalSSLAlert
andNoSSLError
is raised, the worker callingcommunicate
will die.β What is the motivation / use case for changing the behavior?
Better exception handling
π‘ To Reproduce
no way to reproduce this by purpose
π‘ Expected behavior
Thread does not crash
π Details
π Environment
The text was updated successfully, but these errors were encountered: