Skip to content

Harden HTTP/2 client response flow control for large bodies - #952

Open
fewensa wants to merge 1 commit into
mainfrom
codeon/fewensa/FWN-370/a2-10a389f69274429a9179c0e53c9cdd7e
Open

Harden HTTP/2 client response flow control for large bodies#952
fewensa wants to merge 1 commit into
mainfrom
codeon/fewensa/FWN-370/a2-10a389f69274429a9179c0e53c9cdd7e

Conversation

@fewensa

@fewensa fewensa commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Harden the bounded h2c client so response bodies larger than the 65535 initial window complete with 32 KiB stream and connection WINDOW_UPDATE frames.

Fail closed on zero WINDOW_UPDATE increments, send-window overflow, idle or other-stream WINDOW_UPDATE, and connection-level DATA. Keep existing other-stream DATA ignore behavior.

Protocol tests cover invalid increments, overflow, stream mismatch, connection-level DATA, and DATA over the 65535 window. A client/server round trip with a body larger than 65535 passes, and existing bounded h2c tests remain passing.

codeon:
  version: 1
  authority: FWN-370
  description: |-
    Fail closed on invalid WINDOW_UPDATE increments, overflow, idle/other-stream WINDOW_UPDATE, and connection-level DATA. Keep 32 KiB stream and connection WINDOW_UPDATE on non-final DATA so bodies larger than the 65535 window complete, while other-stream DATA remains ignored.
    
    Add protocol tests for those violations plus DATA over the initial window, and a bounded h2c client/server round trip with a response body larger than 65535.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T13:43:41.832753Z ce98233 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce982333e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1794 to +1795
} else {
Err(idle_window_update_error())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow WINDOW_UPDATE for the upgraded stream

When using emit_http2_upgrade, stream 1 represents the HTTP/1.1 upgrade request while the client opens stream 3, so a server may legally send a late WINDOW_UPDATE for stream 1 while it is half-closed or closed. This branch classifies every non-current stream as idle and aborts the otherwise valid stream-3 response; track the upgraded stream state and ignore permissible late updates rather than rejecting all other stream IDs.

Useful? React with 👍 / 👎.

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