openhuman
openhuman copied to clipboard
Security: Client-side JWT decode without verification in socketService.ts
Summary
app/src/services/socketService.ts — getSocketUserId() decodes the JWT payload with a raw atob() call and no signature verification. The decoded userId is used to scope Redux socket state (setStatusForUser, setSocketIdForUser, resetForUser).
Impact
Low — If the token in memory is tampered (e.g., via IPC compromise), the locally decoded userId could scope state to the wrong user, causing data leakage across user sessions.
Suggested Fix
Source the user ID from the already-authenticated CoreStateProvider snapshot (snapshot.auth.userId) instead of decoding the JWT client-side.