Skip to content

Limit the number of Continuation frames per HTTP2 Headers#13969

Merged
normanmaurer merged 8 commits into4.1from
limit_continuation_frame
Mar 24, 2026
Merged

Limit the number of Continuation frames per HTTP2 Headers#13969
normanmaurer merged 8 commits into4.1from
limit_continuation_frame

Conversation

@normanmaurer
Copy link
Copy Markdown
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

@ejona86
Copy link
Copy Markdown
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
Copy Markdown
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'.

Copy link
Copy Markdown
Member

@chrisvest chrisvest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing but otherwise looks good.

Copy link
Copy Markdown
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the need for style/docs mentioning "small." But the approach LGTM

normanmaurer and others added 3 commits March 23, 2026 10:44
Co-authored-by: Bryce Anderson <bl_anderson@apple.com>
@normanmaurer
Copy link
Copy Markdown
Member Author

@bryce-anderson all addressed... PTAL

@normanmaurer normanmaurer added needs-cherry-pick-4.2 This PR should be cherry-picked to 4.2 once merged. needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. labels Mar 23, 2026
Copy link
Copy Markdown
Contributor

@bryce-anderson bryce-anderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm other than defining what small means.

Copy link
Copy Markdown
Member

@chrisvest chrisvest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good. Spotted one style issue. I'd also like a definition for "small" though I don't fully understand Bryce's proposed phrasing.

@bryce-anderson
Copy link
Copy Markdown
Contributor

bryce-anderson commented Mar 23, 2026

I'd also like a definition for "small" though I don't fully understand Bryce's proposed phrasing.

Indeed, I tried to clean it up a bit more. Don't feel compelled to take my suggestions as is but users should know that small means < 8KiB.

normanmaurer and others added 2 commits March 24, 2026 08:12
Co-authored-by: Bryce Anderson <bl_anderson@apple.com>
Co-authored-by: Chris Vest <mr.chrisvest@gmail.com>
@normanmaurer normanmaurer merged commit 9f47a7b into 4.1 Mar 24, 2026
19 checks passed
@normanmaurer normanmaurer deleted the limit_continuation_frame branch March 24, 2026 12:39
netty-project-bot pushed a commit that referenced this pull request Mar 24, 2026
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

---------

Co-authored-by: Bryce Anderson <bl_anderson@apple.com>
Co-authored-by: Chris Vest <mr.chrisvest@gmail.com>
(cherry picked from commit 9f47a7b)
netty-project-bot pushed a commit that referenced this pull request Mar 24, 2026
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

---------

Co-authored-by: Bryce Anderson <bl_anderson@apple.com>
Co-authored-by: Chris Vest <mr.chrisvest@gmail.com>
(cherry picked from commit 9f47a7b)
@netty-project-bot
Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #16535

@netty-project-bot
Copy link
Copy Markdown
Contributor

Auto-port PR for 4.2: #16536

@github-actions github-actions bot removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Mar 24, 2026
@github-actions github-actions bot removed the needs-cherry-pick-4.2 This PR should be cherry-picked to 4.2 once merged. label Mar 24, 2026
normanmaurer added a commit that referenced this pull request Mar 24, 2026
…ers (#16536)

Auto-port of #13969 to 4.2
Cherry-picked commit: 9f47a7b

---
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

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Bryce Anderson <bl_anderson@apple.com>
Co-authored-by: Chris Vest <mr.chrisvest@gmail.com>
normanmaurer added a commit that referenced this pull request Mar 24, 2026
…ers (#16535)

Auto-port of #13969 to 5.0
Cherry-picked commit: 9f47a7b

---
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

Co-authored-by: Norman Maurer <norman_maurer@apple.com>
Co-authored-by: Bryce Anderson <bl_anderson@apple.com>
Co-authored-by: Chris Vest <mr.chrisvest@gmail.com>
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.

6 participants