Skip to content

Fix max_incomplete_event_size for complete oversized headers - #206

Open
Pitchfork-and-Torch wants to merge 1 commit into
python-hyper:masterfrom
Pitchfork-and-Torch:cook/enforce-max-incomplete-on-complete-headers
Open

Pitchfork-and-Torch wants to merge 1 commit into
python-hyper:masterfrom
Pitchfork-and-Torch:cook/enforce-max-incomplete-on-complete-headers

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown

Summary

  • Enforce max_incomplete_event_size when a complete header event is parsed, not only on NEED_DATA.
  • Fixes framing-dependent acceptance of oversized request/response headers (one chunk accepted, split rejected).
  • Adds regression coverage for a single-chunk oversized request.

Closes / relates to #182.

Test plan

  • pytest h11/tests/test_connection.py::test_max_incomplete_event_size_countermeasure
  • CI

Previously the size limit was only checked when next_event() returned
NEED_DATA, so oversized request/response headers that arrived in a
single chunk (or otherwise completed without an incomplete overflow)
were accepted while the same bytes split across packets were rejected.
Enforce the limit using bytes consumed by header events as well
(python-hyper#182).
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