Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CONNECT currently accepts invalid Will Topic names, including wildcards, empty names, null characters and malformed UTF-8. Validate the Will Topic while decoding CONNECT, before the server can accept the connection.
The internal reader uses strict UTF-8 decoding and the existing topic-name checks, plus null-character rejection. Both MQTT 3.1.1 and MQTT 5 decoder paths use it. Other string fields and public APIs are unchanged.
Specification basis: MQTT 5.0 sections 3.1.3.3 [MQTT-3.1.3-11], 1.5.4 [MQTT-1.5.4-1, MQTT-1.5.4-2], 4.7.3 [MQTT-4.7.3-1, MQTT-4.7.3-2], and CONNECT validation [MQTT-3.1.4-1]. MQTT 3.1.1 has the corresponding Will Topic, UTF-8, topic-name, and CONNECT validation requirements.
https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html
https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html
On unmodified master 18731d9, synthetic CONNECT packets with Will Topic
a/#receive successful CONNACK under both MQTT 3.1.1 and MQTT 5. The TCP regression tests now observe connection closure before acceptance. Decoder regressions cover empty topics, wildcards, embedded null, overlong encoding, encoded surrogate, invalid leading byte and truncated UTF-8. Positive cases retain ordinary topics, slash/empty levels, dollar prefix, supplementary Unicode, BOM and literal U+FFFD.Validation:
Connect_To_Invalid_Server_Wrong_IP: expected cancellation, got connection failure). That exact test passed when run separately on both unmodified master and this branch. No test exclusions or production changes were used to address it.git diff --checkpasses.Release solution build passed with three warnings in unchanged benchmark code.