Exposed keys
Credible secret in page
This check finds secret API keys, private keys and passwords left in your public page code, where anyone who views the page can copy them.
Why it matters
A working secret key in page code can be copied by anyone and used to run up bills, read your data or act as your account. Bots scan public pages for keys constantly. Scanetra reports the key type and where it is, never the value.
What Scanetra looks for
- Values that match a provider's documented secret-key format (live or test mode).
- PEM private-key blocks.
- Long, random values under names that suggest a credential.
- Publishable keys and documentation example keys (notes, not issues).
It reads only your homepage's public response. How a scan works
How to fix it
1. Rotate the key first
Revoke or rotate it in the provider's console. Removing it from the page isn't enough: it may already have been copied.
2. Move the calls to your server
Call the provider from a server route or serverless function that keeps the key in an environment variable, and have the page call that route.
3. Remove it from the build
Front-end builds embed variables with public prefixes. Keep secrets out of NEXT_PUBLIC_, VITE_ and REACT_APP_ variables, and out of the repository.
# Exposed to the browser
NEXT_PUBLIC_OPENAI_KEY=sk-...
# Server only
OPENAI_API_KEY=sk-...Replace example.com with your own domain, and test changes on a staging copy first where you can.
Check that it worked
The old key is revoked in the provider's console, and it no longer appears in the page source. Then scan again.
Check your own site
A free scan tells you whether your site passes this check, and the 24 others.