Open eliotsykes opened 1 year ago
This team member is removed from the @team. The removed team member can still receive data from the turbo stream as they have the signed-stream-name.
I think as a first step you can add authentication on the ActionCable level, this will prevent the user from connecting and subscribing to any channel without a valid session.
If the user has a valid session (for example with a new account) i guess authorization has to take place during the subscription to the specific channel.
Example: https://github.com/hotwired/turbo-rails/blob/main/app/channels/turbo/streams_channel.rb#L11 However, i'm not sure what's a good way to authorise the user, maybe it's possible to include a user id in the stream name and then compare it to the user id retrieved from the session (?).
Turbo's signed stream names provided by
turbo_stream_from
never expire: https://github.com/hotwired/turbo-rails/issues/61Example of how this could be a problem
@team
of users:<turbo-cable-stream-source signed-stream-name=...>
tag in their browser.@team
.Potential mitigations?
:channel
option forturbo_stream_from
and the docs forTurbo::StreamsChannel
: https://github.com/hotwired/turbo-rails/blob/main/app/channels/turbo/streams_channel.rb . Is this sufficient? How often are any customTurbo::StreamsChannel
authorization checks invoked - on every message??Turbo.signed_stream_verifier_key
?