Skip to content

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

secrets.env-secret-fallback
Severityhigh
CertaintyObserved — the code as written is the problem
Looks atyour source code
When it runsRuns 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>.

All rules

Your code stays
on your machine

Only findings are uploaded, and only to your own dashboard.