Skip to content
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

Merged
merged 2 commits into from
Aug 28, 2018
Merged

[Security] Fixed issue #214 #216

merged 2 commits into from
Aug 28, 2018

Conversation

imilchev
Copy link
Contributor

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.

@imilchev imilchev changed the title Fixed issue #214 [Security] Fixed issue #214 Aug 28, 2018
@mhverbakel
Copy link
Contributor

Security fix is only the part where the done function is called with the error.

@@ -41,7 +42,7 @@ function handleConnect (client, packet, done) {
}

client.id = packet.clientId || uuid.v4()
client.will = packet.will
client._will = packet.will
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this removed?

Copy link
Contributor Author

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

Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina mcollina merged commit 9e2887a into moscajs:master Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants