ontola / ontola/atomic-server

Deal with chaning Authorization during a WebSocket subscription

Open
#486 0 comments 0 reactions 0 assignees View on GitHub

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 correct read permissions
  • The read permission is taken away
  • Currently, the existing WebSocketConnection will 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_UNSUBSCRIBE messages.
  • 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_rights function

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.