Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the number of Continuation frames per HTTP2 Headers #13969

Open
wants to merge 1 commit into
base: 4.1
Choose a base branch
from

Conversation

normanmaurer
Copy link
Member

Motivation:

We should limit the number of continuation frames that the remote peer is allowed to sent per headers.

Modifications:

  • Limit the number of continuation frames by default to 16 and allow the user to change this.
  • Add unit test

Result:

Do some more validations to guard against resource usage

Motivation:

We should limit the number of continuation frames that the remote peer is allowed to sent per headers.

Modifications:

- Limit the number of continuation frames by default to 16 and allow the user to change this.
- Add unit test

Result:

Do some more validations to guard against resource usage
@ejona86
Copy link
Member

ejona86 commented Apr 11, 2024

Since the default is getting set to 16, this looks like it would break existing users that allow MAX_HEADER_LIST_SIZE > 256 KiB. I'm also not wild about a config option like this which needs a reasonable amount of understanding of how other settings work together.

Could we instead base this off of MAX_HEADER_LIST_SIZE? Or only count CONTINUATIONS that are less than half of 16 KiB (which seems better than half of MAX_FRAME_SIZE), and only allow 1ish of such CONTINUATIONS? Or more simply "reject a CONTINUATION with END_HEADERS=0 if it is less than 8 KiB." Even if we have configuration for these, virtually nobody would need to actually use the setting.

@bryce-anderson
Copy link
Contributor

The implementation looks good but I agree with Eric about his concern regarding a fix number of frames. I do like his solution of rejecting < 8KiB non-terminal continuation frames. The exact size of rejecting could be the tuning parameter where 0 is 'not checked'.

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.

None yet

4 participants