{"id":"CVE-2024-30251","aliases":["CVE-2024-30251","GHSA-5m98-qgg9-wh84","PYSEC-2026-1098"],"related":[],"kind":"vulnerability","state":"published","title":"Denial of service when trying to parse malformed POST requests in aiohttp","summary":"aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. In affected versions an attacker can send a specially crafted POST (multipart/form-data) request. When the aiohttp server processes it, the server will enter an infinite loop and be unable to process any further requests. An attacker can stop the application from serving requests after sending a single request. This issue has been addressed in version 3.9.4. Users are advised to upgrade. Users unable to upgrade may manually apply a patch to their systems. Please see the linked GHSA for instructions.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. In affected versions an attacker can send a specially crafted POST (multipart/form-data) request. When the aiohttp server processes it, the server will enter an infinite loop and be unable to process any further requests. An attacker can stop the application from serving requests after sending a single request. This issue has been addressed in version 3.9.4. Users are advised to upgrade. Users unable to upgrade may manually apply a patch to their systems. Please see the linked GHSA for instructions.","source":"cvelist"},{"lang":"en","text":"### Summary\nAn attacker can send a specially crafted POST (multipart/form-data) request. When the aiohttp server processes it, the server will enter an infinite loop and be unable to process any further requests.\n\n### Impact\nAn attacker can stop the application from serving requests after sending a single request.\n\n-------\n\nFor anyone needing to patch older versions of aiohttp, the minimum diff needed to resolve the issue is (located in `_read_chunk_from_length()`):\n\n```diff\ndiff --git a/aiohttp/multipart.py b/aiohttp/multipart.py\nindex 227be605c..71fc2654a 100644\n--- a/aiohttp/multipart.py\n+++ b/aiohttp/multipart.py\n@@ -338,6 +338,8 @@ class BodyPartReader:\n         assert self._length is not None, \"Content-Length required for chunked read\"\n         chunk_size = min(size, self._length - self._read_bytes)\n         chunk = await self._content.read(chunk_size)\n+        if self._content.at_eof():\n+            self._at_eof = True\n         return chunk\n \n     async def _read_chunk_from_stream(self, size: int) -> bytes:\n```\n\nThis does however introduce some very minor issues with handling form data. So, if possible, it would be recommended to also backport the changes in:\nhttps://github.com/aio-libs/aiohttp/commit/cebe526b9c34dc3a3da9140409db63014bc4cf19\nhttps://github.com/aio-libs/aiohttp/commit/7eecdff163ccf029fbb1ddc9de4169d4aaeb6597\nhttps://github.com/aio-libs/aiohttp/commit/f21c6f2ca512a026ce7f0f6c6311f62d6a638866","format":"markdown","source":"ghsa"},{"lang":"es","text":"aiohttp es un framework cliente/servidor HTTP asíncrono para asyncio y Python. En las versiones afectadas, un atacante puede enviar una solicitud POST (multipart/form-data) especialmente manipulada. Cuando el servidor aiohttp lo procese, el servidor entrará en un bucle infinito y no podrá procesar más solicitudes. Un atacante puede impedir que la aplicación atienda solicitudes después de enviar una sola solicitud. Este problema se solucionó en la versión 3.9.4. Se recomienda a los usuarios que actualicen. Los usuarios que no puedan actualizar pueden aplicar manualmente un parche a sus sistemas. Consulte la GHSA vinculada para obtener instrucciones.","source":"nvd"}],"published":"2024-05-02T13:55:06.135Z","modified":"2026-09-10T03:50:13.407Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-835"],"affected":[{"ranges":[{"version":"< 3.9.4","status":"affected"}],"vendor":"aio-libs","product":"aiohttp","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"-","fixed":"3.9.4","status":"affected"}],"vendor":"aio-libs_project","product":"aiohttp","cpe":"cpe:2.3:a:aio-libs_project:aiohttp:-:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.9.4"}],"ecosystem":"PyPI","package":"aiohttp","purl":"pkg:pypi/aiohttp","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.9.4"}],"vendor":"aiohttp","product":"aiohttp","cpe":"cpe:2.3:a:aiohttp:aiohttp:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.9.4"}],"ecosystem":"PyPI","package":"aiohttp","purl":"pkg:pypi/aiohttp","source":"pysec"}],"references":[{"url":"https://github.com/aio-libs/aiohttp/security/advisories/GHSA-5m98-qgg9-wh84","tags":["patch","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/aio-libs/aiohttp/commit/7eecdff163ccf029fbb1ddc9de4169d4aaeb6597","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/aio-libs/aiohttp/commit/cebe526b9c34dc3a3da9140409db63014bc4cf19","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/aio-libs/aiohttp/commit/f21c6f2ca512a026ce7f0f6c6311f62d6a638866","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"http://www.openwall.com/lists/oss-security/2024/05/02/4","tags":["mailing-list","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/02/msg00002.html","tags":["web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-30251","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/aio-libs/aiohttp","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/aiohttp","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-5m98-qgg9-wh84","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2024-05-02T15:13:44.627Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-30251","url":"https://www.cve.org/CVERecord?id=CVE-2024-30251","licence":"CVE Terms of Use","modified":"2025-11-03T20:37:11.081Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5m98-qgg9-wh84","url":"https://github.com/advisories/GHSA-5m98-qgg9-wh84","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:13.407Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-30251","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-30251","licence":"Public domain","modified":"2026-06-17T07:26:36.337Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1098","url":"https://osv.dev/vulnerability/PYSEC-2026-1098","licence":"CC-BY-4.0","modified":"2026-07-07T17:46:25.596Z"}],"updatedAt":"2026-11-25T22:58:39.845Z","epss":{"score":0.01094,"percentile":0.66421,"date":"2026-12-01T12:00:22.000Z"}}