Skip to content
StrikeOps

API Keys and Secrets Exposed in Client-Side JavaScript

HighTypical severity Web applications and APIsCWE-798

01Description

Credentials for third-party or internal services, such as cloud storage keys, payment API secrets or messaging service tokens, were embedded in JavaScript files delivered to users' browsers.

02Impact

Anyone can extract the secrets from the browser and use them directly against the issuing service, potentially accessing data, sending messages or incurring costs in the organization's name.

03Severity

Typically

High

Typically High. Severity follows what the key allows. Critical for keys with write access to cloud, payment or messaging services; Informational for keys designed to be public, such as restricted map keys.

04How to verify

  1. 1Review JavaScript bundles and source maps for key patterns and high-entropy strings.
  2. 2Identify the service and the permissions each key carries using the provider's documented read-only checks.
  3. 3Distinguish publishable keys intended for browsers from secret keys.

Testing note: only test systems you are authorized to test, within the agreed scope and rules of engagement. Verification steps are written for professional testers and avoid destructive techniques.

05Remediation

  1. 1Revoke and rotate exposed secret keys immediately.
  2. 2Move calls that require secrets to a server-side component.
  3. 3Restrict any key that must be public by domain, scope and quota.
  4. 4Add secret scanning to the build pipeline.

06References

Draft findings like this from your own evidence

Book a demo
Book a demo