fix(mqtt): prioritize respecting ok-to-mqtt #5805
Closed
+1
−31
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.
If I'm reading this code correctly, if an MQTT server resolves to an RFC1918 address the packet will always be forwarded to the broker, even if the "OK to MQTT" flag is set to
false
.This smells like a bit of a privacy concern. If users have explicitly opted out of having their packets published to an MQTT broker, it shouldn't matter if that server is resolving to an RFC1918 address or not. It's very trivial to run an MQTT broker that is publicly accessible, but configure your client to post to this via a simple TCP proxy that suddenly violates the "OK to MQTT" flag that other clients may have specified.
It's possible this logic exists for some other reason that I don't understand, so happy to close this if I'm wrong here.