REDHAT-BUG-2526562: High severity pypi/tornado vulnerability
Tornado is a Python web framework and asynchronous networking library. Prior to 6.5.8, Tornado parses application/x-www-form-urlencoded request bodies with urllib.parse.parseqs in tornado/escape.py without passing maxnumfields. RequestHandler.execute in tornado/web.py parses the body before handler dispatch through HTTPServerRequest.parsebody and parsebodyarguments in tornado/httputil.py, so an unauthenticated request body containing millions of separator-delimited fields can synchronously stall the single-threaded event loop and delay every connection. The body is bounded only by maxbuffersize, which defaults to 104857600 bytes. This issue is fixed in version 6.5.8.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Tornadoto a version that resolves this vulnerability.Fixed in 6.5.8
Event History
Frequently Asked Questions
Who is exposed to this denial-of-service issue?
Applications using Tornado before 6.5.8 that accept application/x-www-form-urlencoded request bodies are exposed. The vulnerable parsing occurs before request-handler dispatch, so authentication does not protect the affected parsing path.
What does an attacker need to do to trigger the issue?
An attacker only needs to send an unauthenticated form-encoded request body containing millions of separator-delimited fields. Parsing happens synchronously on Tornado's single-threaded event loop, which can delay every connection.
Are default deployments affected?
Yes. The request body is limited by max_buffer_size, which defaults to 104857600 bytes, but the vulnerable parser does not set a maximum field count.
What can be done if upgrading is not immediately possible?
Reduce the maximum accepted request-body size from the default max_buffer_size to limit how many separator-delimited fields can be supplied. This mitigates the attack volume but does not add a field-count limit to the vulnerable parser.
What version fixes the issue?
The issue is fixed in Tornado version 6.5.8.