Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(security): publish messages only to authenticated clients #119

Merged

Conversation

eino
Copy link
Contributor

@eino eino commented Oct 12, 2022

Check with _valid_token is imperfect as it is a global flag, and is enforced only for incoming messages. Thus it's possible for a client to connect silently to the socket, never send a handshake. As long as there's at least one authenticated client, those unauthenticated clients will currently receive messages and attachments.

Store the list of authenticated clients in a authentified_client_ids set.
Use it for incoming message, and only broadcast to websockets who have passed authentication.

@eino eino force-pushed the fix/publish-message-to-authenticated-clients branch from 54d4d30 to c630baa Compare October 13, 2022 14:08
@jourdain jourdain merged commit 38d61df into Kitware:master Oct 13, 2022
@jourdain
Copy link
Collaborator

🎉 This PR is included in version 1.8.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@eino eino deleted the fix/publish-message-to-authenticated-clients branch October 13, 2022 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants