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

Mosquitto should not send CONNACK on re-authentication with wrong credentials. #2339

Closed
hvxl opened this issue Oct 11, 2021 · 2 comments
Closed
Labels
Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Milestone

Comments

@hvxl
Copy link

hvxl commented Oct 11, 2021

When re-authentication fails due to bad credentials, mosquitto sends a CONNACK message with reason code 135. This is the second CONNACK within the connection. That is explicitly prohibited by conformance statement MQTT-3.2.0-2 ("The Server MUST NOT send more than one CONNACK in a Network Connection"). As I understand it, a broker is supposed to send a DISCONNECT message (with reason code 135) in this situation.

Something like reauth_not_authorized.diff.txt might fix it.

The issue has been checked against the latest check-in of the master branch (9afeeb1, version 2.0.12) on linux.

@ralight
Copy link
Contributor

ralight commented Oct 12, 2021

Thanks very much, I've committed a change in the fixes branch.

@ralight ralight added Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug labels Oct 12, 2021
@ralight ralight added this to the 2.0.13 milestone Oct 12, 2021
@hvxl
Copy link
Author

hvxl commented Oct 13, 2021

Thanks. I see you applied the same change to the MOSQ_ERR_NOT_SUPPORTED leg. I did not include that in my patch because I don't see how that code can ever be reached in a re-authenticate scenario. If extended authentication is not supported, a client would not be able to connect with extended authentication in the first place, much less re-authenticate. But it doesn't harm either.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants