Medium severityJavaScript / TypeScriptSensitive Data ExposureMEDIUM confidence
Sensitive Data Client Storage
A token, secret, or PII value is written to localStorage/sessionStorage or a client-readable cookie, where any script can read it (XSS token theft).
Standards mapping
- CWE
- CWE-312: Cleartext Storage of Sensitive InformationCWE-922: Insecure Storage of Sensitive Information
- OWASP Top 10
- A04:2021 - Insecure Design
- OWASP ASVS
- V8.3.4 (L2)V8.1.1 (L2)
Vulnerable vs. safe
Flagged by this check
localStorage.setItem("access_token", token);Passes - the safe pattern
localStorage.setItem("theme", "dark");Why it matters & how to fix it
A token, secret, or PII value is written to localStorage/sessionStorage or a client-readable cookie, where any script can read it (XSS token theft). Keep secrets server-side and use httpOnly cookies for session tokens.
References
Rule ID integsec-js-sensitive-data-client-storage - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Sensitive Data ExposureError Stack In Response
- JavaScript / TypeScript - Sensitive Data ExposurePII PHI In Logs
- JavaScript / TypeScript - Sensitive Data ExposureSecret In Logs
- JavaScript / TypeScript - Sensitive Data ExposureSensitive Data In URL Query
- Python - Sensitive Data ExposureFlask Traceback In Response
- Python - Sensitive Data ExposureHardcoded PII Literal