New
Introducing React Bench, see how different models perform on React code

react-doctor/secret-in-fallback

Hardcoded secret fallback for env var

  • Category: Security
  • Severity: error
  • Source: oxlint-plugin-react-doctor
  • Framework: global
  • Enabled when: always
  • Tags: security-scan
  • Default: Enabled

Validation prompt

Use this to decide whether a fired diagnostic is real or a false positive.

Confirm the reported code matches Hardcoded secret fallback for env var. Check the framework context and diagnostic message before suppressing it.

Fix prompt

Use this once validation confirms the diagnostic is real.

Remove the literal fallback and fail closed (throw when the variable is unset). The hardcoded value is a committed secret, and the ??/|| default makes the app run with it in any environment that forgot to set the var.

More Security rules from the rules reference: