Bump centrifuge and protocol for stream decoder message-size limit - #1203
Merged
Conversation
Bump github.com/centrifugal/protocol to v0.21.0 and github.com/centrifugal/centrifuge to the release that passes a message size limit to the stream command decoder. protocol v0.21.0 requires a positive limit when constructing a stream command decoder, since an unbounded decoder over untrusted input can be driven to allocate arbitrary memory by a single frame declaring a huge length. See GHSA-4r3x-2rwr-6w65. The WebTransport handler already passes the configured message size limit; harden its coercion to reject a non-positive value (<= 0) so a negative config cannot reach the decoder, which would panic. Update the client handler tests for centrifuge's new HandleReadFrame signature.
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.
Summary
Closes the last link of the protobuf stream-decoder allocation DoS (GHSA-4r3x-2rwr-6w65) in Centrifugo:
v0.21.0— a positive message size limit is now mandatory when constructing a stream command decoder (an unbounded decoder over untrusted input can be driven to allocate arbitrary memory by a single frame declaring a huge length).HandleReadFrame(WS/SSE/HTTP-stream/emulation).Changes
internal/wt/handler.go): it already passed the configuredmessage_size_limit; harden its coercion from== 0to<= 0so a negative config can't reach the decoder (which would panic on a non-positive limit).HandleReadFrame(c, r, messageSizeLimit)signature.1.26.5→1.26.6in test and release workflows.Transitive dependency bumps
go mod tidypulledrueidis→v1.0.77andtestify→v1.12.0, required by the new centrifuge.Verification
Builds clean;
internal/wtandinternal/clienttests pass against the new deps.