Email sign-in token has no server-side redemption check (confirmed in code; asymmetric with the sibling code+email flow; live replay not executed)
Summary
Summary
getUserForEmailSigninToken (server/utils/jwt.ts) validates an email-signin token's type, its 10-minute expiry, that the request IP matches the IP recorded at issuance, and its JWT signature — but never checks or records whether the token has already been redeemed, and nothing in the cal...
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| otherOutline |
< 1.12.0→ 1.12.0 |
1.12.0 |
Original description The description as published by the source.
Summary
getUserForEmailSigninToken (server/utils/jwt.ts) validates an email-signin token's type, its 10-minute expiry, that the request IP matches the IP recorded at issuance, and its JWT signature — but never checks or records whether the token has already been redeemed, and nothing in the call path invalidates it after a successful sign-in. I confirmed this by reading the function and its call site directly, not by inference. I have not executed a live replay against a running instance, so please verify end-to-end; this is reported as source-confirmed, not runtime-confirmed. This review started from an AI-assisted source analysis tool I developed.
Details
server/utils/jwt.ts, getUserForEmailSigninToken: checks payload.type === "email-signin", the 10-minute createdAt expiry, payload.ip !== ctx.request.ip, and JWT.verify(token, user.jwtSecret). No check against any persisted "used" or "redeemed" state, and no state is written to mark the token as spent.
plugins/email/server/auth/email.ts, emailCallback (the only caller): calls getUserForEmailSigninToken(ctx, token) for the magic-link path and simply proceeds to signIn() on success — no invalidation step. By contrast, the sibling branch in the very same function, for the code+email flow, explicitly invalidates on use: after User lookup and VerificationCode.verify(...), it calls "await VerificationCode.delete(team.id, email); // Delete the code after successful verification". The token (magic-link) path has no equiv…
Source: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV
References
- GITHUB_REPO_ADVISORY outline/outline