Deal with chaning Authorization during a WebSocket subscription
Open
Nobody has claimed this yet.
security
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 82
- Avg merge
- 10h 34m
- Merged PRs (30d)
- 205
Description
- Client
SUBSCRIBEs to some resource, and they have the correctreadpermissions - The
readpermission is taken away - Currently, the existing
WebSocketConnectionwill not be aware of the change in permissions, and will keep sending relevant Commits.
How do we deal with this?
Make SUBSCRIBE messages only temporary valid
- We still need to communicate about how long this time is, to make sure users do not send sensitive information in this time range
- Will lead to some overhead in client + server due to re-subscribing (and re-authorizing) resources
- Relatively easy to implement
- Should the Server inform the Client that it's time to re-subscribe? E.g. send
AUTO_UNSUBSCRIBEmessages. - Alternative, yet similar: make WebSocketConnection only temporarily valid.
Perform authorization checks before sending the Commit, instead of when doing the SUBSCRIBE
- Very secure
- Will be costly in highly dynamic / active environments (think chatrooms or live boards and things like that)
- Should probably only be done if we have a cheaper / properly cached
check_rightsfunction
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. First inspect the WebSocketConnection subscription and authorization flow, then compare the temporary-subscription and per-Commit authorization options. Done means the chosen behavior is specified and permission changes no longer allow unauthorized Commits to be sent.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100