diff options
| author | Natalia <124304+nessita@users.noreply.github.com> | 2026-03-05 14:41:44 -0300 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-04-07 07:22:16 -0400 |
| commit | 0910af60468216c856dfbcac1177372c225deb76 (patch) | |
| tree | a536b8c35c18724366514bce5153d834e3f5a95b /tests/asgi/tests.py | |
| parent | 428c48f358c5a0ed5ca2834fb721d615eb2b0e11 (diff) | |
[6.0.x] Fixed CVE-2026-33033 -- Mitigated potential DoS in MultiPartParser.
When a multipart file part used `Content-Transfer-Encoding: base64` and
the non-whitespace base64 bytes did not align to a multiple of 4 within
a chunk, the parser entered a loop calling `field_stream.read(1-3)` once
per whitespace byte. Each such call fetched the entire internal buffer,
sliced off 1-3 bytes, and pushed the remainder back via unget(), doing
an O(n) memory copy per call. A 2.5 MB payload of mostly whitespace
produced CPU amplification relative to a normal upload of the same size.
The alignment loop now reads `self._chunk_size` bytes at a time, and
accumulates stripped parts in a list joined once at the end.
Thanks to Seokchan Yoon for the report and the fixing patch.
Backport of 7e9885f99cee771b51692fadc5592bdbf19641aa from main.
Diffstat (limited to 'tests/asgi/tests.py')
0 files changed, 0 insertions, 0 deletions
