You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The regular expression used to validate MQTT resource strings is too restrictive and does not allow all characters allowed by the MQTT spec.
To Reproduce
One possible way to reproduce is to publish to an MQTT topic containing single quotes (from a client device). I'm sure there are other characters that should be allowed as well. E.g. 'clients/Demodev2/sensor'
Expected behavior
The requested topic resource should be allowed and be evaluated against an appropriate device group policy.
Actual behavior
An IllegalArgumentException is thrown.
[ERROR] (nioEventLoopGroup-5-2) io.moquette.broker.NewNettyMQTTHandler: Error processing protocol message: PUBLISH. {} java.lang.IllegalArgumentException: Resource mqtt:topic:'clients/Demodev2/sensor' is not in the form of ([a-zA-Z]+):([a-zA-Z]+):([\w -\/:-@\[-\{-~]+)`
Environment
OS: N/A
JDK version: JDK 8
Nucleus version: N/A
Client Device Auth version: 2.0.2
Additional context
This bug prevents client devices from publishing/subscribing on certain MQTT topics and topicfilters which are allowable by the MQTT spec.
The text was updated successfully, but these errors were encountered:
Describe the bug
aws-greengrass-client-device-auth/src/main/java/com/aws/greengrass/device/PermissionEvaluationUtils.java
Line 27 in fc43dc7
The regular expression used to validate MQTT resource strings is too restrictive and does not allow all characters allowed by the MQTT spec.
To Reproduce
One possible way to reproduce is to publish to an MQTT topic containing single quotes (from a client device). I'm sure there are other characters that should be allowed as well. E.g.
'clients/Demodev2/sensor'
Expected behavior
The requested topic resource should be allowed and be evaluated against an appropriate device group policy.
Actual behavior
An
IllegalArgumentException
is thrown.[ERROR] (nioEventLoopGroup-5-2) io.moquette.broker.NewNettyMQTTHandler: Error processing protocol message: PUBLISH. {} java.lang.IllegalArgumentException: Resource mqtt:topic:'clients/Demodev2/sensor' is not in the form of ([a-zA-Z]+):([a-zA-Z]+):([\w -\/:-@\[-\
{-~]+)`Environment
Additional context
This bug prevents client devices from publishing/subscribing on certain MQTT topics and topicfilters which are allowable by the MQTT spec.
The text was updated successfully, but these errors were encountered: