Skip to content

fix(http): honour Content-Length on every method and reject bad field lines - #3743

Merged
BaseMax merged 1 commit into
mainfrom
fix/http-framing-2
Nov 21, 2026
Merged

BaseMax merged 1 commit into
mainfrom
fix/http-framing-2

Conversation

@BaseMax

@BaseMax BaseMax commented Nov 21, 2026

Copy link
Copy Markdown
Member

GET, HEAD and OPTIONS ignored Content-Length, so their body was read as the next pipelined request. Header lines with whitespace before the colon and obs-fold continuation lines were silently skipped instead of rejected.

Content-Length is now honoured for every method (the body is read and available like any other). Any field line that starts with whitespace or has whitespace between the name and the colon gets 400, as RFC 9112 sections 5.1 and 5.2 require. Transfer-Encoding and duplicate or non-digit Content-Length are still rejected as before.

Tested: new cases in tests/en/general/net_http_smuggling (one response for GET/HEAD/OPTIONS with a body, 400 for the bad field lines; before the fix they gave two responses and 200), plus the nearby net_http tests.

It builds on #3737 (the Content-Length overflow fix, already merged), which matters because that bug becomes reachable through GET too once GET bodies are read.

This replaces #3735, which had fallen behind main and picked up an unrelated merge commit; it is the same change rebased onto main after #3737.

… lines

GET, HEAD and OPTIONS bodies were parsed as the next request. Whitespace before the colon and obs-fold lines now get 400.
@BaseMax
BaseMax requested a review from a team as a code owner November 21, 2026 06:34
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d51c20cd-a6ad-4a6b-b36b-80adaa42408d
Commits

Reviewing files that changed from the base of the PR and between 3731886 and 7378efa.

Files ignored due to path filters: 1

  • tests/en/general/net_http_smuggling.out is excluded by !**/*.out
Files selected for processing: 2

  • std/net/http/ctx_internal.salam
  • tests/en/general/net_http_smuggling.salam
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@BaseMax
BaseMax merged commit 8b7a543 into main Nov 21, 2026
15 checks passed
@BaseMax
BaseMax deleted the fix/http-framing-2 branch November 21, 2026 06:52
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