The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-52804

CVE-2024-52804: Tornadoweb Tornado DoS Vulnerability

CVE-2024-52804 is a denial of service vulnerability in Tornadoweb Tornado caused by quadratic complexity in HTTP cookie parsing. Malicious headers can cause excessive CPU consumption. This article covers technical details, affected versions, impact, and mitigation.

Updated: January 22, 2026

CVE-2024-52804 Overview

CVE-2024-52804 is an Algorithmic Complexity Attack vulnerability in Tornado, a popular Python web framework and asynchronous networking library. The algorithm used for parsing HTTP cookies in Tornado versions prior to 6.4.2 sometimes has quadratic complexity, leading to excessive CPU consumption when parsing maliciously-crafted cookie headers. This parsing occurs in the event loop thread and may block the processing of other requests, causing a denial of service condition.

Critical Impact

Attackers can exploit this vulnerability to cause excessive CPU consumption by sending specially crafted cookie headers, effectively blocking the event loop and preventing the server from processing legitimate requests.

Affected Products

  • Tornadoweb Tornado versions prior to 6.4.2

Discovery Timeline

  • November 22, 2024 - CVE CVE-2024-52804 published to NVD
  • November 3, 2025 - Last updated in NVD database

Technical Details for CVE-2024-52804

Vulnerability Analysis

This vulnerability exists in the HTTP cookie parsing functionality within Tornado's httputil.py module. The flaw stems from the use of an inefficient algorithm that exhibits quadratic time complexity O(n²) when processing certain cookie header patterns. When the event loop thread processes a maliciously crafted cookie header, the parsing operation can consume disproportionate CPU resources relative to the input size.

The vulnerability is classified as CWE-400 (Uncontrolled Resource Consumption), which covers scenarios where an application fails to properly limit the resources it consumes. In this case, the CPU time consumed during cookie parsing can grow exponentially with specifically crafted input, allowing an attacker to tie up server resources with minimal effort.

Since Tornado uses an asynchronous, single-threaded event loop architecture, blocking operations in the event loop have a cascading effect on all other requests being processed. An attacker exploiting this vulnerability could effectively deny service to all users of the application.

Root Cause

The root cause lies in the original _unquote_cookie function implementation, which was copied from Python's standard library (http.cookies._unquote). The vulnerable code used two separate regular expression patterns (_OctalPatt and _QuotePatt) that were applied iteratively, resulting in quadratic complexity when processing cookies with many escape sequences. Each pattern match and string operation compounded the computational cost.

Attack Vector

This vulnerability can be exploited remotely over the network without authentication. An attacker needs only to send HTTP requests with maliciously crafted Cookie headers to a Tornado-based application. The attack requires no special privileges and no user interaction. The crafted cookies contain patterns that maximize the iteration count of the vulnerable parsing algorithm, causing CPU exhaustion on the server.

python
             yield (k, v)
 
 
-_OctalPatt = re.compile(r"\\[0-3][0-7][0-7]")
-_QuotePatt = re.compile(r"[\\].")
-_nulljoin = "".join
+_unquote_sub = re.compile(r"\\(?:([0-3][0-7][0-7])|(.))")..sub
+
+
+def _unquote_replace(m: re.Match) -> str:
+    if m[1]:
+        return chr(int(m[1], 8))
+    else:
+        return m[2]
 
 
 def _unquote_cookie(s: str) -> str:
     """Handle double quotes and escaping in cookie values.
 
-    This method is copied verbatim from the Python 3.5 standard
+    This method is copied verbatim from the Python 3.13 standard
     library (http.cookies._unquote) so we don't have to depend on
     non-public interfaces.
     """

Source: GitHub Tornado Commit

The fix replaces the inefficient dual-pattern approach with a single compiled regex substitution (_unquote_sub) that handles both octal escapes and other escaped characters in a single pass, reducing the complexity from O(n²) to O(n).

Detection Methods for CVE-2024-52804

Indicators of Compromise

  • Unusually high CPU utilization on servers running Tornado applications
  • Slow response times or timeouts across all endpoints during attack periods
  • HTTP requests containing abnormally large or complex Cookie headers with multiple escape sequences
  • Event loop blocking indicators in application logs

Detection Strategies

  • Monitor for HTTP requests with Cookie headers exceeding normal size thresholds or containing unusual patterns of escape sequences
  • Implement request rate limiting and cookie size validation at the reverse proxy or load balancer level
  • Deploy application performance monitoring (APM) to detect event loop blocking events
  • Analyze web server access logs for requests with anomalous cookie patterns

Monitoring Recommendations

  • Set up alerts for sustained high CPU usage on Tornado application servers
  • Monitor request latency percentiles (p95, p99) for sudden degradation indicating potential DoS
  • Implement logging for requests that exceed cookie parsing time thresholds
  • Use SentinelOne Singularity Platform to monitor for resource exhaustion patterns indicative of algorithmic complexity attacks

How to Mitigate CVE-2024-52804

Immediate Actions Required

  • Upgrade Tornado to version 6.4.2 or later immediately
  • Implement request filtering at the edge to limit cookie header sizes
  • Consider deploying a web application firewall (WAF) with rules to detect abnormally complex cookie patterns
  • Review all applications using Tornado and prioritize patching based on exposure

Patch Information

The vulnerability is fixed in Tornado version 6.4.2. The patch updates the _unquote_cookie function in tornado/httputil.py to use a more efficient single-pass regex substitution approach, based on the implementation from Python 3.13's standard library. The fix is available in the official Tornado commit.

Additional security advisories are available at the GitHub Security Advisory. Debian users should refer to the Debian LTS Announcement for distribution-specific patches.

Workarounds

  • Deploy a reverse proxy (nginx, HAProxy) in front of Tornado applications with cookie header size limits
  • Implement middleware to pre-validate and reject cookies exceeding reasonable complexity thresholds before they reach Tornado's parser
  • Use connection timeouts and request rate limiting to minimize the impact of exploitation attempts
  • Consider running multiple Tornado instances behind a load balancer to distribute the impact of potential attacks
bash
# Example nginx configuration to limit cookie header size
# Add to nginx server block configuration
large_client_header_buffers 4 8k;
# Reject requests with excessively large cookies
if ($http_cookie ~* ".{4096,}") {
    return 413;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechTornadoweb

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.12%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-400
  • Technical References
  • GitHub Security Advisory

  • GitHub Security Advisory

  • Debian LTS Announcement
  • Vendor Resources
  • GitHub Tornado Commit
  • Related CVEs
  • CVE-2023-28370: Tornadoweb Tornado Open Redirect Flaw
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English