Skip to content

Security: Authentication tokens stored in localStorage (XSS-exfiltration risk)#102

Open
tomaioo wants to merge 1 commit into
ZhFahim:mainfrom
tomaioo:fix/security/authentication-tokens-stored-in-localsto
Open

Security: Authentication tokens stored in localStorage (XSS-exfiltration risk)#102
tomaioo wants to merge 1 commit into
ZhFahim:mainfrom
tomaioo:fix/security/authentication-tokens-stored-in-localsto

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 26, 2026

Summary

Security: Authentication tokens stored in localStorage (XSS-exfiltration risk)

Problem

Severity: High | File: web/features/auth/store.ts:L8

Access and refresh tokens are persisted in localStorage. Any successful XSS in the web app or third-party script compromise can read and exfiltrate these tokens, leading to account takeover and session hijacking.

Solution

Store session tokens in secure, HttpOnly, SameSite cookies managed by the backend. Avoid exposing refresh tokens to JavaScript. If migration is gradual, at minimum reduce token lifetime and enforce CSP + strong XSS defenses.

Changes

  • web/features/auth/store.ts (modified)

Access and refresh tokens are persisted in `localStorage`. Any successful XSS in the web app or third-party script compromise can read and exfiltrate these tokens, leading to account takeover and session hijacking.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant