Repository navigation
Conversation
Contributor
Author
|
My agents claim that the current patch is not fully complete, I'll see if I can update it. |
…e request A client sending a WebSocket frame in the same write as the upgrade request (before the 101) has that frame decoded when the handshaker replaces the HTTP decoder, before the WebSocket VertxHandler replaces the HTTP connection handler. The frame reached Http1ServerConnection#handleOther which silently dropped it without releasing its buffer, leaking pooled memory under client control. Http1ServerConnection now buffers such frames until the upgrade completes and forwards them to the WebSocket handler, or releases them when the upgrade fails or the connection closes. Since a frame decoded during the upgrade usually sits in the connection inbound queue until the handshake listener has run, a frame dequeued after the upgrade completed is forwarded directly and a frame dequeued after the upgrade failed is released directly. Any other unexpected message is released as well. Reading the channel is paused while frames are buffered, so a client flooding the connection before it receives the 101 cannot grow the buffer beyond the bytes already read, and resumed once the 101 is written, before the WebSocket is handed over to the application so an application pause is not overridden. A pipelined frame with RSV bits set was decoded before any extension decoder was installed (they are added once the 101 is written) and cannot be interpreted: it is rejected as a protocol violation instead of being delivered. Known limitation: a forwarded frame is read by both the HTTP connection and the WebSocket connection, so its bytes are reported twice to the bytesRead network metrics. This only affects clients sending frames before the 101, which RFC 6455 forbids, and is deemed acceptable. Assisted-by: Anthropic Claude (claude-opus-5-5) Signed-off-by: Sanne Grinovero <sanne@commonhaus.dev>
Sanne
force-pushed
the
ws-pipelined-frame-leak
branch
from
October 30, 2026 15:50
ac6b156 to
2b59c7a
Compare
Contributor
Author
|
Updated now - the main differences:
|
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.
Fixes #6475
A client sending a WebSocket frame in the same write as the upgrade request (before the 101) has that frame decoded when the handshaker replaces the HTTP decoder, before the WebSocket VertxHandler replaces the HTTP connection handler. The frame reached Http1ServerConnection#handleOther which silently dropped it without releasing its buffer, leaking pooled memory under client control.
Http1ServerConnection now buffers such frames until the upgrade completes and forwards them to the WebSocket handler (or releases them when the upgrade fails or the connection closes), and releases any other unexpected message.
Assisted-by: Anthropic Claude (claude-opus-5-5)