UI icon indicating copy to clipboard operation
UI copied to clipboard

API and Websocket Keys Leakage

Open Securitybits-io opened this issue 3 years ago • 4 comments

The WebUI leaks the RestAPI and Websocket tokens in the javascript source code! These should not be reflected back to the user as that can lead to unintended requests through for example XSS.

API Bearer Token

SourceCode_RestAPI-key

Websocket Token

SourceCode_WebSocket-key

Securitybits-io avatar Feb 16 '22 09:02 Securitybits-io

@naman108 please verify if that is still the case in the current version

brothercorvo avatar Jan 28 '24 20:01 brothercorvo

This is definitely still an issue

naman108 avatar Mar 10 '24 18:03 naman108

I think this issue can be reasonably decomposed into three parts:

  1. insecure communications between client and server due to HTTP
  2. generic web socket key
  3. API token in text

1: insecure communications

IMO, this is probably the most relevant factor for the security conscious user as the other two pertain mostly to cases where an attacker already has access to the UI. To address this issue we would need two main changes:

  • add automatic UI certificate generation
  • add configuration to Flask to use generated certificates

2: Generic Websockets Keys

I think we could reasonably address this by enabling API tokens for use in the web sockets that way every user has a uniquely identifying access token for FTS which can be revoked.

3: API token in text

In general, we expect that the authenticated user knows their API token however clearly this is an issue over HTTP as anyone listening could get access to the API token. This would bring us back to issue 1, where we should provide the user with an easy mechanism to enable HTTPS.

naman108 avatar Apr 23 '24 14:04 naman108

@brothercorvo @Securitybits-io what are your thought's on this?

naman108 avatar Apr 23 '24 14:04 naman108