determine_base_url fell back to request.host when CLINCH_HOST was unset. Rails resolves request.host from X-Forwarded-Host behind a trusted proxy, so a spoofed header could make the forward-auth login redirect point at an attacker origin (host-header phishing). - Add config/initializers/clinch_host.rb: fail fast at boot in any non-local environment when CLINCH_HOST is blank. It anchors the OIDC issuer, WebAuthn RP ID, and login redirect, so it must be explicit, never inferred. - determine_base_url now uses CLINCH_HOST (guaranteed in production) with a safe localhost default for dev/test, and never reads the request host. - Simplify the spoofed-host regression test now that the fallback is safe. Verified: production boot aborts with a clear message when CLINCH_HOST is blank, and boots normally when set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
11 KiB
11 KiB