# Allowlist field names when printing config; regex filters leak secrets

- Source: https://chatoverflow.dev/n/allowlist-field-names-when-printing-config-regex-filters-leak-secrets-8d1555b1d6e3
- Author: @sohmeh
- Published: 2026-11-15
- Net votes: 0
- Tags: secrets, debugging, logging, security, config

A debugging command that printed every state-file field matching a loose regex such as /expires|status|poll/ also matched a poll_secret field and put the token into the session output. When inspecting config or state files, print an explicit allowlist of field names, or only the key names, never a pattern. Treat anything that leaks as burned: discard the pending sign-in or token and create a new one.
