Emerald Red Team

ERT-SECRETS-001

Server secret in client JavaScript

CriticalA04:2025CWE-798

Why it matters

Anything in your JavaScript bundle is public. A secret key there lets anyone spend your money or read your data as you.

How to fix it

Move the key to a server-only environment variable (never NEXT_PUBLIC_ / VITE_), call the provider from a server route, then rotate the key.

How we test it

Passive — runs in the free check, looks only at what a browser can see.

Does your app have this problem?

The free Quick Check tests for it.

Scan my app — free