Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
streams: Fix autosubscribe security bug (CVE-2017-0881).
A bug in Zulip's implementation of the "stream exists" endpoint meant that any user of a Zulip server could subscribe to an invite-only stream without needing to be invited by using the "autosubscribe" argument. Thanks to Rafid Aslam for discovering this issue.
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -481,7 +481,7 @@ def stream_exists_backend(request, user_profile, stream_id, autosubscribe): | |
| result = {"exists": bool(stream)} | ||
| if stream is not None: | ||
| recipient = get_recipient(Recipient.STREAM, stream.id) | ||
| if autosubscribe: | ||
| if not stream.invite_only and autosubscribe: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
timabbott
Author
Member
|
||
| bulk_add_subscriptions([stream], [user_profile]) | ||
| result["subscribed"] = is_active_subscriber( | ||
| user_profile=user_profile, | ||
|
|
||
Wouldn't it be better to centralise this check? Either in
bulk_add_subscriptions()or in somecan_add_to_stream(stream, user, actor)method.