Access control
Auth token saved in localStorageaccess.token-in-web-storage
Anything in localStorage or sessionStorage can be read by every script on the page. If one dependency or one XSS bug runs attacker code, the token is copied out and the account is taken over, even after the user closes the tab.
- In force Rule access.token-in-web-storage
- 3 clauses
At a glance
| Severity | medium |
|---|---|
| Certainty | Needs review — a heuristic; confirm before changing code |
| Looks at | your source code |
| When it runs | Runs on every scan |
How to fix it
Keep the session in an HttpOnly, Secure, SameSite cookie set by your server (most auth libraries do this for you), or keep short-lived tokens in memory only.
Check your own app
Run npx scanlyfix scan in your project. Every finding gets an id; after fixing, npx scanlyfix verify <id> proves it is gone.
If it is a false positive in your project, silence that one line with // scanlyfix-ignore-next-line access.token-in-web-storage -- <why>.
Your code stays
on your machine
Only findings are uploaded, and only to your own dashboard.
ScanlyFix
Security, privacy pages, SEO and AI visibility checked in one scan, with fixes your AI editor can apply.
Home