Do not allow subscribing to Base channel#40685
Merged
kaspth merged 1 commit intorails:masterfrom Nov 25, 2020
Merged
Conversation
Closes rails#40482 Prior to this commit it was possible to subscribe with `ActionCable::Channel::Base` as the subscription class. While it doesn't seem possible to exploit this in away way, it also doesn't seem like something we need to allow. This commit swaps [Module#>=][gte] with [Module#>][gt] to prevent subscribing to a channel when `ActionCable::Channel::Base` is the subscription class. [gte]: https://ruby-doc.org/core-2.5.3/Module.html#method-i-3E-3D [gt]: https://ruby-doc.org/core-2.5.3/Module.html#method-i-3E
| end | ||
| end | ||
|
|
||
| test "subscribe command with Base channel" do |
Member
Author
There was a problem hiding this comment.
Not sure how valuable this test is. I can remove it if folks don't think it is useful.
Contributor
|
Seems fine, thanks! 😄 |
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.
Closes #40482
Prior to this commit it was possible to subscribe with
ActionCable::Channel::Baseas the subscription class. While it doesn'tseem possible to exploit this in away way, it also doesn't seem like
something we need to allow.
This commit swaps Module#>= with Module#> to prevent
subscribing to a channel when
ActionCable::Channel::Baseis thesubscription class.