-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Room passwords #402
Room passwords #402
Conversation
lib/Room.php
Outdated
@@ -284,6 +321,10 @@ public function enterRoomAsUser($userId) { | |||
$result = $query->execute(); | |||
|
|||
if ($result === 0) { | |||
if ($this->getPassword() !== '' && $this->getPassword() !== $password) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use hash_equals
instead of !==
to compare secret with user-provided value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well we don't compare hashes yet. Also see the note in docs:
http://php.net/manual/en/function.hash-equals.php
Both arguments must be of the same length to be compared successfully. When arguments of differing length are supplied, FALSE is returned immediately and the length of the known string may be leaked in case of a timing attack.
Also I'm pretty sure you can not do timing attacks against nextcloud apis 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hash_equals
can be used to compare any kind of strings, be it hashes or PINs.
Leaking the length of the secret is fine, it is specified in this open source code after all.
Also I'm pretty sure you can not do timing attacks against nextcloud apis
I wouldn't bet on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaking the length of the secret is fine, it is specified in this open source code after all.
- There is no secret neither PINs, we have a room password here
- The length is unknown, since it will be provided by the owner of the room
- It's not specified in any code Oo?
Don't get me wrong, we will do our best to make this more secure in the end after the basic functionality works, but there seem to be a couple of misunderstandings here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's now using OCP\Security\IHasher
lib/Room.php
Outdated
*/ | ||
public function enterRoomAsGuest() { | ||
public function enterRoomAsGuest($password) { | ||
if ($this->getPassword() !== '' && $this->getPassword() !== $password) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hash_equals
@@ -48,6 +49,8 @@ class Room { | |||
private $token; | |||
/** @var string */ | |||
private $name; | |||
/** @var string */ | |||
private $password; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this value ever read from the database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the manager
7945656
to
d815a2a
Compare
Codecov Report
@@ Coverage Diff @@
## master #402 +/- ##
============================================
- Coverage 11.02% 10.55% -0.48%
- Complexity 388 406 +18
============================================
Files 24 25 +1
Lines 1832 1914 +82
============================================
Hits 202 202
- Misses 1630 1712 +82
Continue to review full report at Codecov.
|
11cf133
to
120a618
Compare
@Ivansss seems like signaling is going crazy with this: The thing is, So signaling should only start on success of |
@fancycode as per above, we are adding room passwords which need to be passed in while joining a room (as guest or internal user which follows a public link and was not added as a participant before) Please also see the commit above: 14e79c5 can you confirm this will also work on your signaling?
|
db8ca2d
to
90dc934
Compare
if (result.status === 403) { | ||
// Invalid password | ||
OC.dialogs.prompt( | ||
t('spreed', 'Please enter the password for this call'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it would be nice to have the room object in here so we can show the name, if that is okay to leak...
1856a25
to
a929fd6
Compare
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
a929fd6
to
9257615
Compare
Ready for testing now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works 👍
Fix #36