Skip to content

http: bound chunked framing lines and answer malformed bodies with 400 - #3721

Merged
benoitc merged 3 commits into
masterfrom
fix/chunked-quadratic-cpu
Aug 30, 2026
Merged

http: bound chunked framing lines and answer malformed bodies with 400#3721
benoitc merged 3 commits into
masterfrom
fix/chunked-quadratic-cpu

Conversation

@benoitc

@benoitc benoitc commented Aug 30, 2026

Copy link
Copy Markdown
Owner

A chunk-size line or trailer with no terminator was reread in full on every socket read and had no size limit, so a single request could keep a worker busy and never reach the application.

Cap those lines by the existing request limits, keep the scan position instead of rescanning, and return 400 Bad Request for a malformed chunked body instead of a logged traceback.

A chunk-size line or trailer with no terminator was reread in full on every socket read and had no size limit; cap it and keep the scan position.
@benoitc
benoitc force-pushed the fix/chunked-quadratic-cpu branch 2 times, most recently from d6c55d2 to 55f6c02 Compare August 30, 2026 22:18
Classify the chunk framing errors as parse errors so they return 400 instead of a logged traceback.
@benoitc
benoitc force-pushed the fix/chunked-quadratic-cpu branch from 55f6c02 to e66a15b Compare August 30, 2026 22:48
@benoitc
benoitc merged commit 572d63a into master Aug 30, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant