feat(preconf): harden HTTP server limits#3119
Open
fridrik01 wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## tls-preconf-server-hardening #3119 +/- ##
================================================================
+ Coverage 60.01% 60.22% +0.21%
================================================================
Files 384 384
Lines 20055 20079 +24
================================================================
+ Hits 12036 12093 +57
+ Misses 7028 6986 -42
- Partials 991 1000 +9
🚀 New features to boost your workflow:
|
calbera
reviewed
Jun 26, 2026
calbera
left a comment
Contributor
There was a problem hiding this comment.
lgtm but can we add e2e tests for the scenarios you mentioned were previously possible (but shouldn't be anymore)?
previously accepted unbounded request bodies, had no read/write/idle timeouts, and no cap on concurrent connections
bar-bera
reviewed
Jun 26, 2026
bar-bera
left a comment
Collaborator
There was a problem hiding this comment.
agree on testing. Also MaxHeaderBytes (DefaultMaxHeaderBytes = 1 << 20 // 1 MB) and MaxResponseHeaderBytes (default at 10 MB), not game changing since connections are already limited but maybe you want to consider them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR hardens the preconf HTTP server and validator client against DoS and OOM, The sequencer is internet-facing, so it previously accepted unbounded request bodies, had no read/write/idle timeouts, and no cap on concurrent connections, leaving it open to OOM, Slowloris, and connection-exhaustion attacks.
More specifically, the main changes are:
MaxBytesReader(2 KB) ->413on oversized bodies.netutil.LimitListener(256).max-response-size, to prevent a malicious sequencer OOMing a validator. Picked 16 MiB which should cover the worst-case valid block, full hex-encoded transactions (~6 MiB) + 6 blobs (~1.5 MiB) with ~2× headroom.