laravel-websockets/src
Fabian @ Blax Software 7c9ae46738 BF accept client events only from members of the channel
handleProtocolMessage() relayed every client-* frame to the named channel
before handleChannelSubscriptions() and shouldRejectMessage() ran, with no
membership check. Client messages are on by default, so a socket whose
private or presence subscribe was just refused, or one that never
subscribed, could push frames to every member. The "Subscription not
established" error went out only after the broadcast, and the frame was
then forked to a controller as well.

- A client event is relayed only when the sender is on the channel (or
  tracked there, as shouldRejectMessage() allows). Otherwise the sender
  gets "<event>:error" "Subscription not established".
- Either way the frame ends there: client events no longer reach a child.
- The legacy Server\WebSocketHandler applies the same membership check and
  now honours enable_client_messages, which it ignored.

Members keep whispering on public, private and presence channels; the
Pusher rule that limits client events to private/presence channels is not
applied, so public-channel whispers keep working.

Tests: a non-member (and, for private-, private-encrypted- and presence-,
one whose subscribe was refused) gets the error and reaches no member;
members' client events still reach the others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 12:27:44 +01:00
..
Apps A tests, documentation for helpers and lifecycle 2026-04-02 12:44:16 +02:00
Attributes feat: enhance websocket attribute handling with prefix and suffix support; add HTTP controller fallback for event resolution; implement comprehensive tests for dispatcher and event registry 2026-04-29 08:29:49 +02:00
Broadcast IBF broadcasting socket 2026-02-03 16:30:59 +01:00
Cache A tests, documentation for helpers and lifecycle 2026-04-02 12:44:16 +02:00
ChannelManagers BF nullable deprecations 2026-04-23 11:56:50 +02:00
Channels BF keep unsubscribe frames from joining private/presence channels 2026-11-04 12:25:42 +01:00
Console/Commands fix(fork): children never outlive the server or hold its port (#2465) 2026-10-14 10:38:11 +02:00
Contracts BF refuse a broken app key or failed app lookup without stopping the server 2026-11-04 12:25:54 +01:00
Events A tests, documentation for helpers and lifecycle 2026-04-02 12:44:16 +02:00
Facades A tests, documentation for helpers and lifecycle 2026-04-02 12:44:16 +02:00
Identity F IdentityFormatter contract — apps override how the User column renders 2026-04-27 13:50:22 +02:00
Ipc fix(auth): re-establish auth guard in fork child; suppress EPIPE on peer-gone write 2026-08-04 10:21:44 +02:00
Routing feat: integrate websocket routes into Laravel's route list; implement RouteListInjector for attribute-tagged methods and legacy controllers; add tests for route injection and collection 2026-04-29 09:26:53 +02:00
Server BF accept client events only from members of the channel 2026-11-04 12:27:44 +01:00
Services A tests, documentation for helpers and lifecycle 2026-04-02 12:44:16 +02:00
Websocket BF accept client events only from members of the channel 2026-11-04 12:27:44 +01:00
Helpers.php RI websocket performance, BF race condition 2026-01-24 12:17:46 +01:00
ServerFactory.php Renovation 2025-01-16 08:54:02 +01:00
WebSocketsServiceProvider.php feat: integrate websocket routes into Laravel's route list; implement RouteListInjector for attribute-tagged methods and legacy controllers; add tests for route injection and collection 2026-04-29 09:26:53 +02:00
helpers_global.php R cache, connection session, performance 2026-02-09 13:50:42 +01:00