Full-codebase-audit 2026-05-30 outputs: - Audit report: 09 - Audits/Full Codebase Audit - 2026-05-30.md - 81 issue files ISSUE-055..135 (decisions + 1 skipped no-brainer). - Scanner docs from scratch (was zero): architecture, data model, API ref, payment flow, operations runbook + repo README. - Doc-sync updates across API reference, data models, flows, design system. - Secret Rotation Runbook (08 - Operations) for the exposed credentials. - Reusable workflow guide (07 - Development) + .claude/workflows/full-codebase-audit.js. Issues remain status:open intentionally — the code fixes are uncommitted-then-committed working-tree changes per repo and aren't "resolved" until merged/deployed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
issue, title, severity, domain, labels, status, created, source
| issue | title | severity | domain | labels | status | created | source | |||
|---|---|---|---|---|---|---|---|---|---|---|
| 081 | Frontend: auth tokens stored in localStorage — XSS-accessible | medium | Authentication |
|
open | 2026-05-30 | Full Codebase Audit 2026-05-30 |
Frontend: auth tokens stored in localStorage — XSS-accessible
Severity: medium Domain: Authentication Labels: security, frontend, session
Description
src/auth/context/jwt/action.ts:100 stores access and refresh tokens in localStorage. Any XSS vulnerability can steal these tokens and impersonate the user. The risk is compounded by the lack of a Content-Security-Policy (see ISSUE-083).
Options
- Move refresh token to HttpOnly cookie, keep short-lived access token in memory — strong, but requires backend cookie + CSRF work.
- Keep localStorage but add strict CSP + sanitization to reduce XSS surface — cheaper, weaker.
- Full cookie-based session with
SameSite=strict— strongest, largest change to axios/socket auth.
Recommendation
Plan a migration to HttpOnly refresh cookie + in-memory access token, coordinated with backend. This is a large, cross-cutting change that breaks many call sites — treat as a deliberate project.
Affected Files
frontend/src/auth/context/jwt/action.ts:100frontend/src/lib/axios.ts— auth header injection