Opus finding
action parameter silently coerced — typos default to 'enable'
lowapi-contracthigh
- apps/web/app/api/opt-in/route.ts:38-40
Any value that isn't exactly 'disable' (including 'Disable', 'DISABLE', 'off', or a misencoded variant) falls back to enable. If the onboarder ever emits a different casing, or a user hand-edits the URL intending to disable, they silently enable instead. For an opt-in surface that flips a public visibility flag, the asymmetry is risk-relevant: failing open to enable when disable was intended could publish data the user wanted hidden.
Recommendation
Reject unknown action values with a 400 errorPage. Match case-insensitively only if intentional.