-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
[Security] Fixed issue #214 #216
Conversation
Security fix is only the part where the |
@@ -41,7 +42,7 @@ function handleConnect (client, packet, done) { | |||
} | |||
|
|||
client.id = packet.clientId || uuid.v4() | |||
client.will = packet.will | |||
client._will = packet.will |
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.
Can you please restore this?
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.
Restoring this would mean that the LWT is still sent in case the authentication fails or the client times out before the authentication is resolved
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.
Can you please add the definition of this property to lib/client.js
with a comment explaining it?
@@ -71,29 +72,28 @@ function authenticate (arg, done) { | |||
function negate (err, successful) { | |||
var errCode | |||
if (!err && successful) { | |||
client.broker.registerClient(client) |
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.
why is this removed?
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 is not removed but moved to a separate function which is executed after the will was stored. Check line 21
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.
LGTM
Fixed issue #214. It turned out that LWT are being stored and sent on authentication failure as well. I fixed that and added 2 test cases - one for keep-alive timeout being triggered during authentication and one for authentication failure.