{"id":"CVE-2026-53540","aliases":["CLSA-2026-1782781170","DEBIAN-CVE-2026-53540","EUVD-2026-38325","GHSA-v9pg-7xvm-68hf","PYSEC-2026-3040","SUSE-SU-2026:22372-1","UBUNTU-CVE-2026-53540","openSUSE-SU-2026:11099-1","openSUSE-SU-2026:21066-1"],"status":"published","title":"Python-Multipart: Negative Content-Length in parse_form buffers the entire body in memory","description":"Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.","severity":{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"low","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00342,"percentile":0.27936,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-1284"],"published":"2026-06-15T20:23:45Z","modified":"2026-10-28T02:30:31Z","fixes":[{"ecosystem":"PyPI","package":"python-multipart","fixed_in":["0.0.31"],"sources":["ghsa","osv"]},{"ecosystem":"TuxCare:PyPI","package":"python-multipart","fixed_in":["0.0.6.post4+tuxcare"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"python-multipart","fixed_in":["0.0.32-1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.31"}]}]},{"source":"osv","ecosystem":"TuxCare:PyPI","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.6"},{"fixed":"0.0.6.post4+tuxcare"}]}],"versions":["0.0.6","0.0.6.post1+tuxcare","0.0.6.post2+tuxcare","0.0.6.post3+tuxcare"]},{"source":"osv","ecosystem":"Debian:12","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0.17-1","0.0.17-2","0.0.17-3","0.0.17-4","0.0.17-5","0.0.20-1","0.0.20-1.1","0.0.20-1.1~deb13u1","0.0.22-1","0.0.26-1","0.0.32-1","0.0.5-3","0.0.6-1","0.0.9-1"]},{"source":"osv","ecosystem":"Debian:13","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0.20-1","0.0.20-1.1","0.0.20-1.1~deb13u1","0.0.22-1","0.0.26-1","0.0.32-1"]},{"source":"osv","ecosystem":"Debian:14","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.32-1"}]}],"versions":["0.0.20-1","0.0.20-1.1","0.0.20-1.1~deb13u1","0.0.22-1","0.0.26-1"]},{"source":"osv","ecosystem":"PyPI","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.31"}]}],"versions":["0.0.1","0.0.10","0.0.11","0.0.12","0.0.13","0.0.14","0.0.15","0.0.16","0.0.17","0.0.18","0.0.19","0.0.2","0.0.20","0.0.21","0.0.22","0.0.23","0.0.24","0.0.25","0.0.26","0.0.27","0.0.28","0.0.29","0.0.3","0.0.30","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.0.9"]},{"source":"osv","ecosystem":"PyPI","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.31"}]}],"versions":["0.0.1","0.0.10","0.0.11","0.0.12","0.0.13","0.0.14","0.0.15","0.0.16","0.0.17","0.0.18","0.0.19","0.0.2","0.0.20","0.0.21","0.0.22","0.0.23","0.0.24","0.0.25","0.0.26","0.0.27","0.0.28","0.0.29","0.0.3","0.0.30","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.0.9"]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 16.0","package":"python-python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.20-160000.5.1"}]}],"bundled":4},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP applications 16.0","package":"python-python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.20-160000.5.1"}]}],"bundled":4},{"source":"osv","ecosystem":"Ubuntu:Pro:22.04:LTS","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0.5-2","0.0.5-2ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:24.04:LTS","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0.5-3","0.0.6-1","0.0.9-1","0.0.9-1ubuntu0.1~esm1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0.20-1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0.20-1.1","0.0.26-1","0.0.32-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0.20-1","0.0.20-1.1"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"python-python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.32-1.1"}]}],"bundled":3},{"source":"osv","ecosystem":"openSUSE:Leap 16.0","package":"python-python-multipart","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.20-160000.5.1"}]}],"bundled":4}],"products":[{"vendor":"fastapiexpert","product":"python-multipart"},{"vendor":"kludex","product":"python-multipart"}],"references":[{"url":"https://github.com/Kludex/python-multipart/security/advisories/GHSA-v9pg-7xvm-68hf","tags":["x_refsource_CONFIRM","Vendor Advisory","advisory","web"]},{"url":"https://github.com/advisories/GHSA-v9pg-7xvm-68hf","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53540.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53540","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-53540","tags":["advisory"]},{"url":"https://github.com/Kludex/python-multipart","tags":["package"]},{"url":"https://pypi.org/project/python-multipart","tags":["package"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-202622372-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1268488","tags":["report"]},{"url":"https://bugzilla.suse.com/1268496","tags":["report"]},{"url":"https://bugzilla.suse.com/1268500","tags":["report"]},{"url":"https://bugzilla.suse.com/1268506","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2026-53537","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-53538","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-53539","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2026-53540","tags":["web"]},{"url":"https://ubuntu.com/security/CVE-2026-53540","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-53540","tags":["report"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2026-53540","title":"Python-Multipart: Negative Content-Length in parse_form buffers the entire body in memory","description":"Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.","status":"published","published":"2026-06-22T16:58:54.923Z","modified":"2026-06-22T17:21:55.932Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"low","assessor":"cna"}],"cwes":["CWE-1284"],"updated_at":"2026-11-02T14:20:00.11477Z"}],"euvd":[{"id":"EUVD-2026-38325","description":"Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.","status":"published","published":"2026-06-22T16:58:54Z","modified":"2026-06-22T17:21:55Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"low"}],"updated_at":"2026-11-02T18:20:34.238696Z"}],"ghsa":[{"id":"GHSA-v9pg-7xvm-68hf","title":"python-multipart: Negative Content-Length in parse_form buffers the entire body in memory","description":"### Summary\n\n`parse_form()` did not validate the `Content-Length` header before using it to bound its chunked read of the request body. A negative `Content-Length` turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks.\n\n### Details\n\n`parse_form()` reads the input stream in chunks, never reading more than the remaining `Content-Length` at a time. The per-chunk size is computed as `min(content_length - bytes_read, chunk_size)`. The header value was parsed to an integer without checking its sign, so a `Content-Length` of `-1` made this expression negative, and `input_stream.read(-1)` reads until end of stream. The intended bounded, chunked read therefore collapsed into a single unbounded read of the whole stream. The amount read is still bounded by what the client actually sends.\n\n### Impact\n\nThis only affects code that calls `parse_form()` directly with a `Content-Length` header taken from attacker-controlled input and without normalizing a negative value first. No known package is affected:\n\n* Starlette and FastAPI drive `MultipartParser` directly from the ASGI `receive()` stream and do not call `parse_form()`.\n* Known `parse_form()` consumers either do not forward `Content-Length` to it, recompute it from the already-read body, or run behind a layer (such as Werkzeug) that normalizes a negative `Content-Length` to `0`.\n\nThe realistic exposure is limited to bespoke WSGI or `http.server` handlers that forward raw client headers into `parse_form()`. In that case a crafted request buffers the body in memory at once, degrading availability under concurrent requests rather than causing a complete denial of service.\n\n### Mitigation\n\nUpgrade to version `0.0.31` or later, which rejects a negative `Content-Length` with a `ValueError` before reading the stream.","status":"published","published":"2026-06-15T20:23:45Z","modified":"2026-06-15T20:23:45Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"low"}],"cwes":["CWE-1284"],"updated_at":"2026-11-02T14:40:28.438722Z"}],"nvd":[{"id":"CVE-2026-53540","description":"Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.","status":"published","published":"2026-06-22T18:16:44.497Z","modified":"2026-10-25T23:10:00.167Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"low","assessor":"secondary"}],"cwes":["CWE-1284"],"updated_at":"2026-11-02T14:12:24.912854Z"}],"osv":[{"id":"CVE-2026-53540","title":"Python-Multipart: Negative Content-Length in parse_form buffers the entire body in memory","description":"Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.","status":"published","published":"2026-06-22T16:58:54.923Z","modified":"2026-10-28T02:30:31.613566943Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"low"}],"cwes":["CWE-1284"],"updated_at":"2026-11-02T15:45:08.132336Z"},{"id":"DEBIAN-CVE-2026-53540","description":"Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.","status":"published","published":"2026-06-22T18:16:44.497Z","modified":"2026-10-26T11:47:37.833267119Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"low"}],"updated_at":"2026-11-02T15:45:57.236551Z"},{"id":"GHSA-v9pg-7xvm-68hf","title":"python-multipart: Negative Content-Length in parse_form buffers the entire body in memory","description":"### Summary\n\n`parse_form()` did not validate the `Content-Length` header before using it to bound its chunked read of the request body. A negative `Content-Length` turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks.\n\n### Details\n\n`parse_form()` reads the input stream in chunks, never reading more than the remaining `Content-Length` at a time. The per-chunk size is computed as `min(content_length - bytes_read, chunk_size)`. The header value was parsed to an integer without checking its sign, so a `Content-Length` of `-1` made this expression negative, and `input_stream.read(-1)` reads until end of stream. The intended bounded, chunked read therefore collapsed into a single unbounded read of the whole stream. The amount read is still bounded by what the client actually sends.\n\n### Impact\n\nThis only affects code that calls `parse_form()` directly with a `Content-Length` header taken from attacker-controlled input and without normalizing a negative value first. No known package is affected:\n\n* Starlette and FastAPI drive `MultipartParser` directly from the ASGI `receive()` stream and do not call `parse_form()`.\n* Known `parse_form()` consumers either do not forward `Content-Length` to it, recompute it from the already-read body, or run behind a layer (such as Werkzeug) that normalizes a negative `Content-Length` to `0`.\n\nThe realistic exposure is limited to bespoke WSGI or `http.server` handlers that forward raw client headers into `parse_form()`. In that case a crafted request buffers the body in memory at once, degrading availability under concurrent requests rather than causing a complete denial of service.\n\n### Mitigation\n\nUpgrade to version `0.0.31` or later, which rejects a negative `Content-Length` with a `ValueError` before reading the stream.","status":"published","published":"2026-06-15T20:23:45Z","modified":"2026-09-10T03:50:50.590441047Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"low"}],"cwes":["CWE-1284"],"updated_at":"2026-11-02T15:46:56.981655Z"},{"id":"PYSEC-2026-3040","title":"python-multipart: Negative Content-Length in parse_form buffers the entire body in memory","description":"### Summary\n\n`parse_form()` did not validate the `Content-Length` header before using it to bound its chunked read of the request body. A negative `Content-Length` turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks.\n\n### Details\n\n`parse_form()` reads the input stream in chunks, never reading more than the remaining `Content-Length` at a time. The per-chunk size is computed as `min(content_length - bytes_read, chunk_size)`. The header value was parsed to an integer without checking its sign, so a `Content-Length` of `-1` made this expression negative, and `input_stream.read(-1)` reads until end of stream. The intended bounded, chunked read therefore collapsed into a single unbounded read of the whole stream. The amount read is still bounded by what the client actually sends.\n\n### Impact\n\nThis only affects code that calls `parse_form()` directly with a `Content-Length` header taken from attacker-controlled input and without normalizing a negative value first. No known package is affected:\n\n* Starlette and FastAPI drive `MultipartParser` directly from the ASGI `receive()` stream and do not call `parse_form()`.\n* Known `parse_form()` consumers either do not forward `Content-Length` to it, recompute it from the already-read body, or run behind a layer (such as Werkzeug) that normalizes a negative `Content-Length` to `0`.\n\nThe realistic exposure is limited to bespoke WSGI or `http.server` handlers that forward raw client headers into `parse_form()`. In that case a crafted request buffers the body in memory at once, degrading availability under concurrent requests rather than causing a complete denial of service.\n\n### Mitigation\n\nUpgrade to version `0.0.31` or later, which rejects a negative `Content-Length` with a `ValueError` before reading the stream.","status":"published","published":"2026-07-13T15:46:17.309964Z","modified":"2026-07-13T16:33:29.088234122Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"low"}],"updated_at":"2026-11-02T15:52:56.429374Z"},{"id":"UBUNTU-CVE-2026-53540","description":"Python-Multipart is a streaming multipart parser for Python. Prior to 0.0.31, parse_form() did not validate the Content-Length header before using it to bound its chunked read of the request body. A negative Content-Length turned the bounded read into a read-until-EOF, so the entire body was loaded into memory in a single read instead of in fixed-size chunks. This vulnerability is fixed in 0.0.31.","status":"published","published":"2026-06-22T18:16:00Z","modified":"2026-10-17T13:00:25.223189907Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"low"}],"updated_at":"2026-11-02T16:56:41.382716Z"},{"id":"CLSA-2026-1782781170","title":"TuxCare security update for python-multipart (1 CVE)","description":"TuxCare rebuilt python-multipart to address 1 CVE. Fixed in 0.0.6.post4+tuxcare.","status":"published","published":"2026-08-04T14:52:40Z","modified":"2026-10-15T09:48:05.419127502Z","updated_at":"2026-11-02T15:43:45.794021Z"},{"id":"openSUSE-SU-2026:11099-1","title":"python311-python-multipart-0.0.32-1.1 on GA media","description":"These are all security issues fixed in the python311-python-multipart-0.0.32-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2026-06-22T00:00:00Z","modified":"2026-06-24T09:00:22.394275076Z","updated_at":"2026-11-02T16:58:38.95195Z"},{"id":"openSUSE-SU-2026:21066-1","title":"Security update for python-python-multipart","description":"This update for python-python-multipart fixes the following issues\n\n- CVE-2026-53537: multipart/form-data with extended parameters can lead to file or parameter smuggling (bsc#1268506).\n- CVE-2026-53538: urlencoded requests containing semicolons can lead to form field smuggling (bsc#1268496).\n- CVE-2026-53539: small crafted body can cause a denial of service (bsc#1268500).\n- CVE-2026-53540: crafted request buffers can lead to degrading availability (bsc#1268488).\n","status":"published","published":"2026-06-26T07:58:44Z","modified":"2026-06-30T18:24:38.453792818Z","updated_at":"2026-11-02T16:58:41.885092Z"},{"id":"SUSE-SU-2026:22372-1","title":"Security update for python-python-multipart","description":"This update for python-python-multipart fixes the following issues\n\n- CVE-2026-53537: multipart/form-data with extended parameters can lead to file or parameter smuggling (bsc#1268506).\n- CVE-2026-53538: urlencoded requests containing semicolons can lead to form field smuggling (bsc#1268496).\n- CVE-2026-53539: small crafted body can cause a denial of service (bsc#1268500).\n- CVE-2026-53540: crafted request buffers can lead to degrading availability (bsc#1268488).\n","status":"published","published":"2026-06-26T07:58:40Z","modified":"2026-07-02T18:24:14.95877653Z","updated_at":"2026-11-02T15:54:03.080707Z"}]}}
