← Rule catalog

Source kernel · Security

Secret env var falls back to a literal

rust_doctor::source::secret_env_fallback

Fail at startup when the secret is missing, with ? or an explicit error, instead of falling back to a literal or an empty value that ships in the binary.

Category
Security
Default level
warn
Tier
P1
Producer
Source kernel
Diff scope
item

Not a defect when

The fallback is a well-known local development value that the service refuses to start with outside development, so no deployment can run on it.

What it reads

Source text, without resolving types or expanding macros.

Tier

Serious: worth interrupting other work for.

The tier bounds how severe a rule may be; its category bounds the tier.

Diff scope

The function or item around the changed line.

What --scope contextual looks at to decide whether a change caused the finding.

Change it

Turn it off, or make it blocking, without touching the code it flags:

rust-doctor --rule rust_doctor::source::secret_env_fallback=off .
rust-doctor --rule rust_doctor::source::secret_env_fallback=error .

Set it once in rust-doctor.toml

Other Security rules