
The PitWhere the crew shows up.

An attacker intercepted your magic link and landed inside your user's dashboard. Your passwordless login became a passwordless break-in. Your AI implemented magic link auth. User enters email. Server generates a signed token in a URL. The URL includes a redirect parameter your AI never locked down. An attacker crafts a link with the redirect set to their server. User clicks the real magic link from their real email. Authenticates against your real application. Your server sends the session to the attacker's domain. Direct your AI to validate redirects against an allowlist. Magic link tokens that do not expire remain valid in the email indefinitely. An attacker who gains mailbox access months later finds every link still active. Direct your AI to expire tokens in 10 minutes. Invalidate after first use. Rate limit requests to three per email per hour. Thousands of requests flood the inbox and damage sender reputation. Your magic link removes the password. It should not remove the security.
PROMPT: You are an authentication security auditor specializing in passwordless flows. Review the following magic link implementation for redirect and token lifecycle vulnerabilities. Check: (1) Does the magic link URL include a redirect parameter? If so, is the redirect validated against an allowlist of owned domains? Flag unvalidated redirects as CRITICAL. (2) Do magic link tokens have a TTL? Flag tokens without expiration as CRITICAL. Recommended maximum: 10 minutes. (3) Are tokens invalidated after first use (one-time use enforcement)? Flag reusable tokens as CRITICAL. (4) Is the magic link endpoint rate-limited per email address and per IP? (5) Are previous tokens invalidated when a new magic link is requested? (6) Is the token cryptographically random with sufficient entropy (minimum 32 bytes)? (7) Is the token transmitted only over HTTPS? (8) Does successful authentication via magic link invalidate all previous magic link tokens for that user? For each finding, provide the exact implementation fix.


Comments
Start the Conversation