This page simulates how applications misuse localStorage. Run each test, watch the storage inspector update, and identify which storage patterns are safe and which create exploitable vulnerabilities.
Browsers provide localStorage and sessionStorage for client-side persistence. Unlike httpOnly cookies, storage is fully readable by any JavaScript running on the page. This means any XSS vulnerability can instantly exfiltrate auth tokens, PII, or privilege flags stored there. A second class of bug occurs when the page trusts values the user wrote into storage and uses them to make access control decisions without a server-side check.
| True Negative | Theme preference stored in localStorage. Non-sensitive data, no credentials, appropriate use of client-side storage. |
| Bug Found | Auth token written to localStorage on login. Accessible to any script on the page; one XSS vulnerability is enough to steal the session. |
| Bug Found | role=admin in localStorage is read by the page and used to render admin controls without a server-side verification step. |
| Bug Found | Full name, email, and phone stored as plain text in localStorage. PII readable by every third-party script loaded on the page. |
Saving a UI preference to localStorage. This is the expected, benign use of client-side storage: non-sensitive data the user can recreate at any time.
✓ localStorage.setItem('theme', 'dark')Simulates a login that stores the session token in localStorage instead of an httpOnly cookie. Check the storage inspector below after running this test.
✗ localStorage.setItem('auth_token', '...')The page reads a role key from localStorage and renders the admin panel if its value is admin. No server request is made during the check.
You now see admin content. This section should only be visible after a server-side role check. Any user who opens DevTools and writes role=admin to localStorage can reach this on reload.
Simulates a "Save Profile" action that caches user PII in localStorage for faster page loads. The data is stored unencrypted and is readable by every script on the page.
✗ PII written to localStorage without encryptionShows all keys this page has written to localStorage. Updates automatically after each test.
(empty)
localStorage.getItem('qa_bs_auth_token') from any script on this origin; an XSS payload can steal it in one line (bug found)localStorage.getItem('qa_bs_user_profile') to confirm the data is fully readable (bug found)httpOnly cookies are completely inaccessible to JavaScript; that is the correct pattern for session tokens