Sensitive Data: Bearer Token Leak in JavaScript Bundle¶
Identifier:
js_data_leak_bearer_token
Scanner(s) Support¶
| GraphQL Scanner | REST Scanner | WebApp Scanner | ASM Scanner |
|---|---|---|---|
Description¶
Bearer tokens embedded in first-party JavaScript bundles expose session or API credentials to anyone who can download the script. Because client-side code is fully accessible in the browser, a leaked Bearer token can be replayed to impersonate the user or call protected APIs.
How we test: We statically analyze first-party JavaScript bundles for inline HTTP request configuration that sets an Authorization header with a Bearer token value.
References:
- CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
- CWE-798: Use of Hard-coded Credentials
- OWASP Top 10 Client-Side Security Risks
Configuration¶
Example¶
Example configuration:
Reference¶
issues_count_limit¶
Type : integer
The maximum number of issues to report. Use 0 to report all issues.
skip¶
Type : boolean
Skip the test if true.