[Bug][Security] Auth.Store.ts: Zustand persist middleware stores auth state in localStorage, making token and user data accessible to any JavaScript on the page
@anshul23102 ci sta già lavorando.
Dal 8/6/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- tauri, typescript
- Ambito
- authentication, desktop, security
Direzione di ricerca
Start with src/features/Auth/v1/Store/Auth.Store.ts and inspect how Zustand persist writes the auth token and user data. Review the related Tauri CSP concern and determine whether the intended session flow is memory-only or requires an encrypted store. Done means auth credentials are no longer serialized to plaintext localStorage and the chosen secure re-establishment or persistence behavior is covered.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug Summary
src/features/Auth/v1/Store/Auth.Store.ts uses Zustand's persist middleware with the default storage backend, which is localStorage:
const useAuthStore = create<AuthState>()(
persist(
(set) => ({
token: null,
user: null,
setAuthData: (user: User) => set({ user }),
clearAuthData: () => set({ user: null, token: null }),
}),
{
name: "auth-storage", // key written to localStorage
},
),
);
localStorage is accessible to any JavaScript running in the same origin. In a Tauri application where CSP is disabled (see related issue), this is especially dangerous because injected scripts can read localStorage.getItem('auth-storage') and extract the full auth token and user object without any restriction.
Even with CSP enabled, localStorage is not suitable for storing authentication tokens because:
- It is synchronously readable by all JavaScript on the page, including third-party libraries.
- It persists indefinitely until explicitly cleared, even after the user closes the application.
- It is not HttpOnly -- the fundamental property that makes cookies resistant to XSS-based token theft.
For a Tauri desktop app, sensitive credentials should be stored using Tauri's secure storage plugin (tauri-plugin-stronghold or the OS keychain via tauri-plugin-store with encryption) rather than plaintext localStorage.
Expected Behavior
Auth tokens should not be persisted in localStorage. Session state should be kept in memory only (without the persist middleware) and re-established on app launch via a secure token refresh flow. If persistence is required, use an encrypted store.
Actual Behavior
Auth state (including token and user data) is serialised to plaintext localStorage on every state update.
Affected File
src/features/Auth/v1/Store/Auth.Store.ts
@NexGenStudioDev I would like to work on this issue. Could you please assign/ it to me? Contributing under NSoC '26.
- Lingua principale
- TypeScript
- Stelle
- 7
- Fork
- 17
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NexGenStudioDev/CommDesk
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
NexGenStudioDev/CommDesk#140 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
NexGenStudioDev/CommDesk#138 ·
-
[Bug] signup.ts: uploadCommunityLogo is a simulated stub that converts files to data URLs with no size or type validation, sending multi-megabyte base64 strings in the signup payloadForse di nuovo libera @anshul23102 l’ha presa 127 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
NexGenStudioDev/CommDesk#130 · 2 commenti ·
-
Input text not visible in authentication formsForse di nuovo libera @anshul23102 l’ha presa 127 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NexGenStudioDev/CommDesk#123 · 2 commenti ·
-
[UX] Hardcoded window dimensions not DPI-aware — UI broken on high-DPI displaysForse già presa @anshul23102 l’ha presa 97 giorni fa. Aperta
NexGenStudioDev/CommDesk#141 · 1 assegnatario ·
Tutte le issue di NexGenStudioDev/CommDesk
Issue simili
-
Add: VIVE TVApertaapproved check:passed streams:add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
iptv-org/iptv#55293 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Fission-AI/OpenSpec#2084 ·
I maintainer di solito rispondono entro 2 giorni
-
Contrib indemnité de départ à la retraite : faire le pont avec le simulateur sur la page génériqueApertaP1
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
SocialGouv/code-du-travail-numerique#7561 ·
I maintainer di solito rispondono entro 1 giorno
-
beginner bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
hiero-ledger/hiero-sdk-js#4517 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kubernetes-sigs/headlamp#7950 ·
I maintainer di solito rispondono entro 3 giorni