Aias00 opened a new issue, #6638:
URL: https://github.com/apache/shenyu/issues/6638

   - severity: High
   - files: 
`shenyu-protocol/shenyu-protocol-mqtt/src/main/java/org/apache/shenyu/protocol/mqtt/MqttFactory.java:34`;
 `MessageType.java:31-47`; `Publish.java:47-49`; `Subscribe.java:56-59`; 
`Unsubscribe.java:41-43`
   - description: `MqttFactory` constructs a fresh `MessageType` per inbound 
message; `Connect.connect()` calls `setConnected(true)` on the throwaway 
`Connect` instance, so `isConnected()` never propagates to other handler 
instances. Combined with inverted guards (`if (isConnected()) return;`), the 
"reject operations from unauthenticated clients" enforcement never fires — a 
client that never sent CONNECT can PUBLISH/SUBSCRIBE/UNSUBSCRIBE. Even if state 
persisted, `if (isConnected()) return;` would block connected clients.
   - impact: No connection-state enforcement; pre-auth PUBLISH/SUBSCRIBE 
allowed.
   - suggested_fix: Track connection state per-channel (Channel attribute or 
ChannelRepository); invert guards to `if (!isConnected()) { ...; return; }`.
   - confidence: High
   - related_existing: none
   
   ---
   _Identified during the 2026-08-02 deep re-scan; full list in 
[`docs/scan2-2026-08-02/00-consolidated-critical-high.md`](docs/scan2-2026-08-02/00-consolidated-critical-high.md)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to