Secrets & keys
Secret falls back to a value written in the codesecrets.env-secret-fallback
When the environment variable is missing — a forgotten setting on a new deploy, a renamed variable — the app quietly uses the literal in the code instead. That literal is in your repository, so anyone who sees the code can forge sessions or tokens signed with it.
- In force Rule secrets.env-secret-fallback
- 3 clauses
At a glance
| Severity | high |
|---|---|
| Certainty | Observed — the code as written is the problem |
| Looks at | your source code |
| When it runs | Runs on every scan |
How to fix it
Fail loudly when the variable is missing (throw at startup) instead of falling back, and rotate the secret if a deploy ever ran on the fallback.
Check your own app
Run npx scanlyfix scan in your project. Every finding gets an id; after fixing, npx scanlyfix verify <id> proves it is gone.
If it is a false positive in your project, silence that one line with // scanlyfix-ignore-next-line secrets.env-secret-fallback -- <why>.
Your code stays
on your machine
Only findings are uploaded, and only to your own dashboard.
ScanlyFix
Security, privacy pages, SEO and AI visibility checked in one scan, with fixes your AI editor can apply.
Home