mastodon / flodgatt

A blazingly fast drop-in replacement for the Mastodon streaming API server
GNU Affero General Public License v3.0
86 stars 8 forks source link

Improve security to match Node.js version #21

Closed codesections closed 5 years ago

codesections commented 5 years ago

This PR makes two changes to improve security/conform this codebase to the Node.js version it is replacing (and thus closes #20). Specifically, these changes implement the fixes added in tootsuite/mastodon#10818

First, it checks OAuth scopes and ensures that the client is authorized to read the data it is requesting. This prevents apps that have write-only access (like a Twitter cross-posting bot) from reading user data via the streaming API.

Second, it adds the ability for WebSocket clients to pass the access token via the sec-websocket-protocol header rather than in the query string.