Critical Vulnerability in Python Tornado: Excessive CPU Consumption Due to Cookie Parsing

python-tornado Updated 03 Oct 2025

Summary

22/11/2024
N/A
Yes i
High
7.5

UBUNTU-CVE-2024-52804: Tornado is a Python web framework and asynchronous networking library. Affects python-tornado versions < 4.5.3-1ubuntu0.2+esm1. Fixed in 4.5.3-1ubuntu0.2+esm1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Python Tornado is a powerful web framework and asynchronous networking library designed for building scalable web applications. It is known for its non-blocking network I/O and ability to handle thousands of simultaneous connections. However, certain versions of Tornado have a vulnerability in their HTTP cookie parsing mechanism, which can lead to performance issues under specific conditions.

Vulnerability Detail

The vulnerability in Tornado arises from the algorithm used for parsing HTTP cookies in versions prior to 6.4.2. This algorithm exhibits quadratic complexity, which means that when processing maliciously-crafted cookie headers, it can lead to excessive CPU consumption. This excessive load occurs in the event loop thread, potentially blocking the processing of other requests and degrading the performance of the web application. The vulnerability is identified as CVE-2024-52804 and has a CVSS score of 7.5, indicating a medium severity level.

How To Fix

Minimum fixed version

4.5.3-1ubuntu0.2+esm1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-tornado

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate patching is not feasible, consider implementing rate limiting on cookie headers or validating cookie sizes to prevent excessively large or complex cookies from being processed.

Conclusion

The vulnerability in Python Tornado, identified as CVE-2024-52804, poses a significant risk due to its potential to cause excessive CPU consumption through inefficient cookie parsing. Users are strongly advised to update to version 6.4.2 or higher to mitigate this risk. Additionally, temporary workarounds can be implemented until the update is applied.

See every vulnerability recorded for python-tornado →

Share this vulnerability

FAQ

CVE-2024-52804 is a vulnerability in the Python Tornado framework that can lead to excessive CPU consumption when parsing maliciously-crafted HTTP cookie headers.

You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities. Visit Vulert Scanner to check if your application is affected without requiring any installation.

Versions of Tornado prior to 6.4.2 are affected by this vulnerability. It is recommended to upgrade to version 6.4.2 or higher.

The vulnerability can lead to excessive CPU usage, which may block the processing of other requests, resulting in degraded application performance and user experience.

Yes, you can implement rate limiting on cookie headers or validate cookie sizes to prevent processing of overly complex cookies as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for python-tornado.

How To Fix

Minimum fixed version

4.5.3-1ubuntu0.2+esm1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-tornado

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback