Authorized testing of password-reset and magic-link poisoning: Host / X-Forwarded-Host influence on reset URLs, token leakage via attacker host, open-redirect and cache chains, and token handling flaws. Use when reset, invite, or verify emails embed absolute links built from request authority.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Authorized testing of password-reset and magic-link poisoning: Host / X-Forwarded-Host influence on reset URLs, token leakage via attacker host, open-redirect and cache chains, and token handling flaws. Use when reset, invite, or verify emails embed absolute links built from request authority.
Password Reset Poisoning
Scope And Authorization
Authorized applications only. Trigger resets only for accounts you own (or program-provided mailboxes). Never reset third-party users.
Prefer unique canary domains/collaborators you control, disposable inboxes, and one proof per sink class. Rate-limit email endpoints.
Poisoning shared caches or mass-mailing production users is out of scope unless the program explicitly allows controlled cache tests — default to single-user email proof.
Redact full reset tokens, links, and session cookies from public write-ups; keep complete evidence offline per policy.
Related Host cache issues exist but the primary impact is credential recovery / account takeover via email links — this skill is primary over generic Host testing.
Core Model
Attacker triggers reset for victim@… (must be YOUR test account in assessment)
Request carries Host / X-Forwarded-Host = attacker.tld
App emails: https://attacker.tld/reset?token=SECRET
If a real victim clicked → token hits attacker server → ATO
Variant
Sink
Typical proof
Host header
Host: attacker.tld
Email link host = attacker
X-Forwarded-Host
Edge allows XFH; app trusts proxy headers
Same with valid Host: target
Base URL param
?host=, baseUrl=, hidden form field
Link uses param
Open redirect on reset
Token on trusted host then next= off-site
Token in Referer/query to attacker
Cache-aided
Poisoned Host cached on reset template
Second client sees bad link host (rare for email body)
Token logic
Host OK but token weak/reusable/leaked
Separate handling bugs
Good proof: Controlled mailbox receives reset URL whose authority is attacker-controlled, or token reaches a server you control via redirect/Referer with a complete exploit chain description. Bad proof: Only reflected Host in HTML with no email/link generation; or Host rejected at edge with no origin path.
Workflow
Inventory reset and magic-link surfaces
Map:
Flow
Endpoints to note
Request reset
POST /forgot-password, /api/auth/reset
Token consume
GET/POST /reset-password, /auth/reset/confirm
Magic link
/login/magic, /auth/link
Verify / invite
/verify-email, /invite/accept
Record Content-Type, CSRF on request form, whether email is enumerated, and rate limits. Use api-recon-and-docs if routes are unclear.
Baseline legitimate reset
With correct Host: target.example (and normal forwarded headers if any):
Complete reset once in a clean browser; note whether token is single-use, TTL, and if session is issued (then apply session-fixation-management if SID not rotated).
Host and authority poisoning ladder
Intercept the request that triggers the email (often POST). Keep body identity fields as your account. Mutate authority:
POST /forgot-password HTTP/1.1
Host: attacker.tld
Content-Type: application/x-www-form-urlencoded
email=you%40test.example
OAuth password reset / “login with email” hybrids may need oauth-oidc-misconfiguration.
CSRF on reset request vs reset confirm
Cross-site request of reset email (spam/DoS) — usually low; note if no CSRF.
Cross-site confirm that sets password without token or with leaked token — high; use csrf-cross-site-request-forgery.
Reset confirm that establishes session without regenerate → session-fixation-management.
Cache interaction (optional)
If reset page HTML embeds absolute “request another link” URLs and is cacheable, Host/XFH unkeyed headers may poison the page for others. Prefer email proof for ATO severity. Full cache methodology: http-host-header-attacks / web-cache-deception as appropriate. Do not mass-poison production CDNs.
Origin vs edge
Document:
Edge rejects unknown Host (CDN 403) but origin accepts when hit directly (if origin is in scope).
App trusts X-Forwarded-* from any client (missing trusted-proxy config).
Only internal header from LB is honored — not exploitable from Internet; still report defense-in-depth if origin is reachable.
Remediation guidance
Pair implementation with code-quality-standards:
Build email links from a configured canonical base URL (APP_URL / PUBLIC_URL), never from raw Host / XFH.
If behind proxies: trust X-Forwarded-Hostonly from known proxy IPs; ignore client-supplied overrides.
Allowlist Host at the edge; reject unknown authorities.
Tokens: high entropy, single-use, short TTL, bound to user id and purpose; HTTPS-only links.
After successful reset: invalidate sessions, regenerate session id, optional notify old email.
Avoid putting long-lived tokens in URLs that later redirect off-site; prefer POST body + SameSite session step.
Do not reveal whether an email exists unless product requires it; rate-limit per IP and per account.