Found in the PR #170 review, with a failing test.
Defect: on session resume, restore_existing_session (client_handler/connect.rs) removes subscriptions the client is no longer authorised for from the stored session. But the router kept them since the preserving disconnect (release_client keeps subscriptions), and nothing unsubscribes them.
Effect: a resumed client keeps receiving messages on a topic filter whose ACL was revoked while it was offline.
Fix: remove the revoked filters from the router as well when the session is restored, or re-install the router subscriptions only from the filtered set.
Test: a client subscribes to secret/#, disconnects with a persistent session, the ACL for it is revoked, the client resumes, and it still receives secret/x.
Found in the PR #170 review, with a failing test.
Defect: on session resume,
restore_existing_session(client_handler/connect.rs) removes subscriptions the client is no longer authorised for from the stored session. But the router kept them since the preserving disconnect (release_clientkeeps subscriptions), and nothing unsubscribes them.Effect: a resumed client keeps receiving messages on a topic filter whose ACL was revoked while it was offline.
Fix: remove the revoked filters from the router as well when the session is restored, or re-install the router subscriptions only from the filtered set.
Test: a client subscribes to
secret/#, disconnects with a persistent session, the ACL for it is revoked, the client resumes, and it still receivessecret/x.