Skip to content

Bump centrifuge and protocol for stream decoder message-size limit - #1203

Merged
FZambia merged 2 commits into
masterfrom
security/stream-decoder-message-limit
Aug 17, 2026
Merged

Bump centrifuge and protocol for stream decoder message-size limit#1203
FZambia merged 2 commits into
masterfrom
security/stream-decoder-message-limit

Conversation

@FZambia

@FZambia FZambia commented Aug 17, 2026

Copy link
Copy Markdown
Member

Summary

Closes the last link of the protobuf stream-decoder allocation DoS (GHSA-4r3x-2rwr-6w65) in Centrifugo:

  • protocolv0.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).
  • centrifuge → the release that threads each transport's configured limit into HandleReadFrame (WS/SSE/HTTP-stream/emulation).

Changes

  • WebTransport handler (internal/wt/handler.go): it already passed the configured message_size_limit; harden its coercion from == 0 to <= 0 so a negative config can't reach the decoder (which would panic on a non-positive limit).
  • Client handler tests: updated for centrifuge's new HandleReadFrame(c, r, messageSizeLimit) signature.
  • CI: Go 1.26.51.26.6 in test and release workflows.

Transitive dependency bumps

go mod tidy pulled rueidisv1.0.77 and testifyv1.12.0, required by the new centrifuge.

Verification

Builds clean; internal/wt and internal/client tests pass against the new deps.

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.
@FZambia
FZambia merged commit 558c7dd into master Aug 17, 2026
4 checks passed
@FZambia
FZambia deleted the security/stream-decoder-message-limit branch August 22, 2026 13:11
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