Questions and Remarks for the Security Audit
Primary Goals
These are the main goals of the security audit:
-
Verify that the server can never see content (content text, images, comment text etc.) of documents or folder names. In order words. This assumes that the client is not compromised. This includes that the server can never just inject an entry into a response resulting in a client to encrypt or sign content for the server to get access to data.
-
Verify that the backend service is not vulnerable to common attacks like SQL injection or the Websocket connection can be compromised.
Repositories
The app repository is https://github.com/serenity-kit/serenity (opens in a new tab)
Structure:
- Backend: https://github.com/serenity-kit/Serenity/tree/main/apps/backend (opens in a new tab)
- Frontend used for Web build, Mobile (ReactNative) and Desktop (Electron): https://github.com/serenity-kit/Serenity/tree/main/apps/app (opens in a new tab)
- Internal packages: https://github.com/serenity-kit/Serenity/tree/main/packages (opens in a new tab)
- Electron build: https://github.com/serenity-kit/Serenity/tree/main/apps/desktop-app (opens in a new tab)
Related repositories we developed and use in Serenity:
- https://github.com/serenity-kit/react-native-libsodium (opens in a new tab) (audit out of scope, except for one question futher down)
- https://github.com/serenity-kit/opaque (opens in a new tab) (audit in progress by another team)
- https://github.com/serenity-kit/react-native-opaque (opens in a new tab) (audit in progress by another team)
HTTPS connections
- Are there any HTTP security feautes we should activate? (HSTS is on)
Websocket Connections
- Is passing an authentication token as a query parameter secure enough or what are proposed alternatives? I read this is the only way to pass authentication tokens in a websocket connection.
- Should the
Origin
header be verified to basically simuate CORS checking? Does it provide any additional security in this case? - Should the
Sec-WebSocket-Protocol
header be verified to basically simulate CORS checking? Does it provide any additional security in this case? - Is the
webSocketServer
setup fine or should we restrictmaxPayload
for example? - Is
webSocketServer.handleUpgrade
handled correctly?