-
Notifications
You must be signed in to change notification settings - Fork 265
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
Several protocol violations or bugs in HiveMQ #493
Comments
According to the specification of MQTTv3.1.1:
Replay such packet:
|
According to the specification of MQTTv3.1.1:
Replay such packet:
|
According to the specification of MQTTv3.1.1:
Replay such packet:
|
Hi @panhao410 |
Regarding your first comment:
This is correct behavior, as the user name is actually set; it only has a length of 0, which is not disallowed. |
Some spelling mistakes, sorry. I have corrected them. |
Hi, I also found some new bugs here.
Replay such packet: 102900044d515454048049f4000b45696a5033694430694155001062313166564374ff74614b4e36303536 It is worth mentioning that HiveMQ correctly terminates the connection when dealing with CONNECT packets such as MQTTv5.0 and prompts: 'Sent CONNECT with malformed username. ' , but it seems to be missing on MQTT v3.1.1. |
According to this description, when the Payload Format Indicator in the PUBLISH message is set to 1, the payload in the PUBLISH message must be UTF-8 encoded. However, it appears that HiveMQ does not validate this. PoC:
|
Similarity,
According to this description, when the Payload Format Indicator in the CONNECT message is set to 1, the will message in the CONNECT message must be UTF-8 encoded. However, it appears that HiveMQ does not validate this. POC:
|
Hi @songxpu and @panhao410, Thank you for reporting the issues with HiveMQ CE! We’ve looked over them. Below is the summary.
@songxpu UTF8 validation of the payload for will PUBLISH and ordinary PUBLISH on the server is allowed by MQTT protocol but NOT prescribed. For CONNECT packet, the protocol spec states: “The Server MAY validate that the Will Message is of the format indicated, and if it is not send a CONNACK with the Reason Code of 0x99 (Payload format invalid) as described in section 4.13.”. Basically, the paragraphs 3.1.3.2.3 and 3.3.2.3.2 state the following: the MQTT client MUST conform to the UTF8 format whereas the broker MAY validate the will and PUBLISH payloads that client had sent. In your case, the client misbehaves by not conforming to the MQTT protocol, but the broker is allowed to accept these payloads nevertheless. If you want to enable validation of PUBLISH payloads, then you can configure it via the config.xml file. You should be able to do this by adding the following config into the XML:
You can see the defaults in SecurityConfigurationService I hope, this helps. |
Describe the bug
Hi, I found something on the HiveMQ that is contrary to the protocol specification description (protocol violation or logic bug).
For tracking purposes, I will report all results under this Issue.
Environment Details
Client SDK
If possible include the mqtt sdk you used to connect to hivemq
Minimal C test cases are perferred.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: