diff --git a/advisories/github-reviewed/2024/11/GHSA-gjcc-jvgw-wvwj/GHSA-gjcc-jvgw-wvwj.json b/advisories/github-reviewed/2024/11/GHSA-gjcc-jvgw-wvwj/GHSA-gjcc-jvgw-wvwj.json new file mode 100644 index 00000000000..c69eb58ef90 --- /dev/null +++ b/advisories/github-reviewed/2024/11/GHSA-gjcc-jvgw-wvwj/GHSA-gjcc-jvgw-wvwj.json @@ -0,0 +1,73 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-gjcc-jvgw-wvwj", + "modified": "2024-11-20T21:38:58Z", + "published": "2024-11-20T21:38:58Z", + "aliases": [ + "CVE-2024-52581" + ], + "summary": "Litestar allows unbounded resource consumption (DoS vulnerability) ", + "details": "### Summary\nLitestar offers multiple methods to return a parsed representation of the request body, as well as extractors that rely on those parsers to map request content to structured data types. Multiple of those parsers do not have size limits when reading the request body into memory, which allows an attacker to cause excessive memory consumption on the server by sending large requests.\n\n### Details\nThe `Request` methods to parse json, msgpack or form-data all read the entire request stream into memory via `await self.body()` without a prior size check or size limit. There may be other places (e.g. extractors) where this can happen.\n\nFor most formats, a configurable size limit would be sufficient to mitigate this issue. The total request size can also be limited by a proxy (e.g. nginx) in front of the actual application as a workaround. However, for applications that actually want to accept large file uploads via `multipart/form-data`, a simple size limit would not be practical. The multipart parser currently used by Litestar expects a single byte string as input and does not support incremental parsing via `Request.stream()`. Applications could bypass the Litestar parser and use a [streaming parser](https://pypi.org/project/multipart/) to read from `Request.stream()` instead, but that would not work with extractors and other features of the framework. Switching the parser for a different implementation is currently not possible via public APIs.\n\n### PoC\nStart an applications that accesses `Request.json()`, `Request.msgpack()` or `Request.form()` or uses an extractor that relies on those parsers internally, and send a large request with a matching content type. The actual content of the request does not matter. For example: `curl -F \"foo=