diff options
| author | Adam Soltys <[email protected]> | 2026-08-07 22:58:52 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-07 23:29:24 -0700 |
| commit | 01784219f83f68c7d03eb19c35f05eeaedc74487 (patch) | |
| tree | c96a432094da1a655e98bbdf3f90fcf8e1052d61 /server | |
| parent | bc5b34f053cf35c11a68e57a9c43c987331452a7 (diff) | |
| download | coinos-server-01784219f83f68c7d03eb19c35f05eeaedc74487.tar.gz coinos-server-01784219f83f68c7d03eb19c35f05eeaedc74487.zip | |
sockets: verify JWT signatures on the websocket auth path (S1)
The websocket auth gate used jwt.decode(), which parses the payload but
never checks the signature — anyone could forge {id: <victim uid>}
(alg:none or any key), register their socket under the victim's uid, and
receive every emit for that account. Switch both track() and the "login"
gate to jwt.verify(token, config.jwt), rejecting forged/altered tokens.
Also project the full-record socket emits through pick(user, whitelist)
so a "user" event can never carry the bcrypt hash, TOTP secret, or PIN —
matching the shape /login and /me already return.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat (limited to 'server')
0 files changed, 0 insertions, 0 deletions
