SPB Git

Repository Public

SECURITY-REVIEW.md 4.3 KB 51 lines markdown

1# Security review — 2026-11-18, before public exposure23Scope: the whole repository at the deployed commit. Method: manual review of every server route and of the client4engine, then tests that reproduce each attack. Performed by the author of the code (Claude); **this is not an5independent audit** and does not replace one. Passing tests show that specific attacks fail; they do not prove the6system secure.78## Findings910| # | Severity | Finding | Resolution |11|---|---|---|---|12| 1 | **High** | Clients extended a group to any account the server listed as a member. A malicious server could add a real, enrolled account to a private conversation and that account would receive the keys | Fixed: reconciliation only adds devices of accounts already holding a leaf in the authenticated MLS tree. Test: “an account the server adds to the member list on its own is never given the group keys” |13| 2 | **High** | A welcome message could replace a working group state on a device (an enrolled attacker cooperating with the server could substitute a group for an existing conversation and speak inside it) | Fixed: welcomes are accepted only when the device holds no state; the MLS group id must equal the conversation id; a direct conversation's tree may contain only its two accounts |14| 3 | Medium | Attachment descriptors from other members were used without validation (malformed values could break rendering; file names could contain path separators) | Fixed: strict validation and sanitisation in the engine (`cleanFiles`) |15| 4 | Medium | Messages updated in place (edits, reactions) were not re-rendered: a person could keep seeing stale content | Fixed (revision counter) |16| 5 | Low | Unbounded key-package uploads and self-synced blobs per device | Fixed: caps (120 packages, 200 blobs of 256 KB) |17| 6 | Low | Outbox order depended on random identifiers within the same millisecond | Fixed: monotonic counter; ordering tested |18| 7 | Info | Sessions were created without the manually built browser contexts having media permissions (test harness only) | Test harness corrected |1920## Verified controls2122| Control | Evidence |23|---|---|24| No account without invitation or one-time bootstrap; tokens single use, expirable, revocable | integration tests 1–3 |25| Passkey verification, unknown credential refused, challenge single use, session revocation | test 4 |26| CSRF (SameSite=Strict cookie + Origin check + custom header), WebSocket origin and session checks, security headers, CSP without inline script | test 5; production headers checked |27| Server stores no plaintext (database rows and blob files searched for a marker) | tests 7, 17 |28| Sender authentication, author-only edit/delete | test 8 |29| Removal and revocation cut access, cryptographically and at the API | tests 10, 12, 19 |30| Forged device certificate refused by server and by clients | tests 6, 13, 14 |31| Identity change raises a warning and is not trusted before acceptance | test 16 |32| Attachment tampering, chunk swapping, cross-conversation access, quota | test 17 |33| Rate limiting | test 20 |34| Dependencies | `pnpm audit --prod`: no known vulnerabilities (2026-11-18) |35| Load | 16 accounts, 480 group messages, 7 200 decryptions in 1.2 s, identical order on every device |36| Production | health, headers, WebSocket refusal without session (401), TURN relay end to end, wrong TURN credential refused |3738## Open items (not fixed)39401. Independent audit of `ts-mls` and of this integration: **not done**.412. Real Face ID / Touch ID and real iPhone/iPad/Mac Safari: **not tested** (virtual authenticator in Chromium only).42   WebKit-specific behaviour (IndexedDB eviction after 7 days without use in Safari tabs, media recorder formats) is43   unverified. Installing the site to the Home Screen avoids the eviction policy.443. Group calls with three or more real participants: not tested.454. The Caddy access log on the gateway records request paths; no secret is ever placed in a path.465. TURN uses UDP/TCP 3478 without TLS (media is already encrypted; a `turns:` listener on 443 is not possible while47   UDP 443 is redirected to WireGuard). Networks that only allow 443 will not connect calls.486. Backups stay on the hosting node. An off-node copy is not configured.497. No protection of administrative actions by a fresh passkey check (step-up); an unlocked administrator session can50   invite and disable accounts.51
Files main
Menu

Theme