Skip to content

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:

Configuration

Example

Example configuration:

---
security_tests:
  js_data_leak_bearer_token:
    issues_count_limit: 20
    skip: false

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.