Skip to content
This repository was archived by the owner on May 8, 2023. It is now read-only.
This repository was archived by the owner on May 8, 2023. It is now read-only.

Secure the websocket connection #127

@regner

Description

@regner

Concern: We have a websocket open that would allow anyone that connects to it access to any of the public and private data we push over it.

Scenario: Evil person comes along, creates nifty website, encourages many people to visit web site. After a while evil person adds a little script that attempts to connect to the localhost websocket. If successful it then ships the data off to its own backend.

This would be bad. Very bad.

There are a few ways this could be prevented:

  • The most secure option: Require an authorization header. When the client starts, if there is no password configured in the config file generate one and save it in the config file. For windows we could easily add a menu option to the systray icon that copies the password to the clipboard (I assume Go has an easy option to put a string on the clipboard).
  • The less secure option: Require a specific user-agent be set. A browser will not let applications change the user-agent. I don't know what this would do to things like an Electron application though.
  • Another less secure option: Check the origin header. Browsers will set that to the current page and only accept requests that, if that is set, have it set to localhost.

Thoughts? @pcdummy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions