CVE-2024-52581

7.5 HIGH

📋 TL;DR

Litestar multipart form parser versions before 2.13.0 have no default limit for request body size, allowing attackers to upload arbitrarily large files in multipart/form-data requests. This causes excessive memory consumption on the server, potentially leading to denial of service. All Litestar applications using the built-in multipart parser are affected.

💻 Affected Systems

Products:
  • Litestar ASGI framework
Versions: All versions before 2.13.0
Operating Systems: All operating systems running Litestar
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using Litestar's built-in multipart form parser. Applications using alternative parsers or not handling file uploads may not be vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server outage due to memory exhaustion, causing denial of service for all users and potentially requiring server restart.

🟠

Likely Case

Degraded server performance or temporary unavailability due to memory pressure from large file uploads.

🟢

If Mitigated

Minimal impact with proper request size limits and monitoring in place.

🌐 Internet-Facing: HIGH - Internet-facing applications are directly exposed to malicious uploads from untrusted sources.
🏢 Internal Only: MEDIUM - Internal applications could still be targeted by authenticated users or compromised internal systems.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation is trivial - simply sending large multipart requests. This is a variation of CVE-2023-25578, suggesting attackers may already be familiar with the attack pattern.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.13.0

Vendor Advisory: https://github.com/litestar-org/litestar/security/advisories/GHSA-gjcc-jvgw-wvwj

Restart Required: Yes

Instructions:

1. Update Litestar to version 2.13.0 or later using pip: 'pip install --upgrade litestar>=2.13.0' 2. Restart your application server 3. Verify the update was successful

🔧 Temporary Workarounds

Implement request size limits

all

Configure your web server or reverse proxy to limit request body size before requests reach Litestar

nginx: client_max_body_size 10M;
Apache: LimitRequestBody 10485760

Use alternative multipart parser

all

Replace Litestar's built-in multipart parser with a streaming parser like python-multipart

pip install python-multipart
Configure Litestar to use external parser

🧯 If You Can't Patch

  • Deploy web application firewall (WAF) rules to block or limit large multipart requests
  • Implement rate limiting and monitoring for large file uploads to detect and block abuse

🔍 How to Verify

Check if Vulnerable:

Check your Litestar version: 'pip show litestar' or examine requirements.txt/pyproject.toml for version <2.13.0

Check Version:

python -c "import litestar; print(litestar.__version__)"

Verify Fix Applied:

Confirm version is 2.13.0 or higher: 'pip show litestar | grep Version' should show 2.13.0+

📡 Detection & Monitoring

Log Indicators:

  • Unusually large request sizes in access logs
  • Memory usage spikes coinciding with file upload requests
  • HTTP 413 errors from size limits

Network Indicators:

  • Large Content-Length headers in POST requests
  • Prolonged multipart/form-data uploads
  • Multiple large file uploads from single source

SIEM Query:

source=access_logs method=POST content_type="multipart/form-data" content_length>10000000

🔗 References

📤 Share & Export