Opus finding
Opt-in route never re-validates `payload.owner`/`payload.repo` shape before passing to DB
lowsecuritymedium
- apps/web/lib/optin-token.ts:83-99
- apps/web/app/api/opt-in/route.ts:60-67
Verification only checks types (string), not GitHub's owner/repo grammar (no slashes, length limits, allowed chars). A token signed with `owner: ''` or `owner: '../../etc'` is accepted and passed to the DB query and into HTML (escaped). DB queries are presumably parameterized so SQL injection is not a concern, but a malformed token that someone with the secret could craft would still result in spurious audit rows with bogus identifiers. Severity is low because crafting requires the HMAC secret; this is purely defense-in-depth.
Recommendation
Validate owner/repo against `^[A-Za-z0-9._-]{1,100}$` in verifyTokenDetailed before returning 'ok'.