Skip to content

In-depth lesson · Account takeover

Typical fixes

Every point the Account takeover reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 50 of 270
  1. Build reset links from a fixed configured domain rather than the request Host header.

    Seen in 15 reports
  2. Do not compare attacker-controlled values in a 2FA check; verify the code against a server-side secret.

    Seen in 6 reports
  3. Do not log credentials or request bodies in plaintext, and keep log files out of public directories.

    Seen in 5 reports
  4. Rate limit and lock out repeated one-time code guesses and keep codes valid for only a few minutes.

    Seen in 4 reports
  5. Invalidate old passwords, login QR codes, pending sessions and remember-me tokens when the password changes.

    Seen in 4 reports
  6. Revoke or re-authenticate existing sessions when 2FA is enabled.

    Seen in 4 reports
  7. Revoke all other sessions on password change and logout.

    Seen in 4 reports
  8. Set an expiry on session cookies and regenerate the identifier on login, logout and password reset.

    Seen in 4 reports
  9. Use a random single-use token with a server-enforced expiry, and require authentication for admin resets.

    Seen in 4 reports
  10. Enforce rate limiting and account lockout on OTP verification.

    Seen in 4 reports
  11. Require email verification before granting access and check for existing accounts during OAuth signup.

    Seen in 4 reports
  12. Publish a strict SPF record with a hard fail instead of a soft fail.

    Seen in 3 reports
  13. Require re-verification of any new email address.

    Seen in 3 reports
  14. Enforce rate limiting and account lockout on failed logins.

    Seen in 3 reports
  15. Require email verification before linking social accounts, and use a random single-use token that is not the user identifier.

    Seen in 3 reports
  16. Verify the new phone number before applying it and check that the email address is verified before enabling two-factor.

    Seen in 3 reports
  17. Do not trust client-supplied flags to skip second-factor validation, and enforce rate limiting and lockout.

    Seen in 3 reports
  18. Bind the reset token to the requesting account and do not accept an email or user ID from the request body.

    Seen in 3 reports
  19. Enforce the verification result server-side and never accept a fixed default code.

    Seen in 3 reports
  20. Do not include the reset URL or token in the HTTP response; deliver it only to the account owner's email.

    Seen in 3 reports
  21. Invalidate reset tokens after use and when a new token is generated.

    Seen in 3 reports
  22. Do not accept default or hard-coded OTP values.

    Seen in 3 reports
  23. Invalidate all sessions on password change and logout.

    Seen in 3 reports
  24. Require verification of the new email address before updating it.

    Seen in 3 reports
  25. Verify that the email from the OAuth provider matches the existing account's email before linking.

    Seen in 3 reports
  26. Use a strong signing secret and verify the token signature and claims.

    Seen in 3 reports
  27. Enforce the second factor on all authentication paths, including signup and OAuth linking.

    Seen in 3 reports
  28. Bind the reset token to the account it was issued for and ignore client-supplied user identifiers.

    Seen in 3 reports
  29. Normalise and compare email addresses consistently across registration and recovery, and do not strip special characters during recovery.

    Seen in 2 reports
  30. Generate a fresh 2FA secret for each setup attempt instead of reusing a stored one.

    Seen in 2 reports
  31. Send reset tokens only to the user's email and never return them in the response body.

    Seen in 2 reports
  32. Check that the caller is allowed to change another user's email and require verification before binding a login.

    Seen in 2 reports
  33. Invalidate login and session state tied to the old email when the account email changes.

    Seen in 2 reports
  34. Rate limit and lock out repeated guesses of the current password.

    Seen in 2 reports
  35. Invalidate all reset tokens when the password changes, however the change was made.

    Seen in 2 reports
  36. Bind password changes to the authenticated session and ignore client-supplied identifiers.

    Seen in 2 reports
  37. Do not link OAuth identities by email without verifying ownership and consent.

    Seen in 2 reports
  38. Publish a valid SPF record for the domain.

    Seen in 2 reports
  39. Invalidate sessions created before the last password change.

    Seen in 2 reports
  40. Validate the reset key before changing the password.

    Seen in 2 reports
  41. Rate-limit the first step and enforce the flow steps server-side rather than by referer.

    Seen in 2 reports
  42. Verify that the user ID and email in the update request belong to the authenticated user.

    Seen in 2 reports
  43. Require ownership verification for email changes and restrict role attribute changes.

    Seen in 2 reports
  44. Revoke sessions across all related dashboards on logout and do not auto-login after logout.

    Seen in 2 reports
  45. Use the email address stored for the account instead of a user-supplied email address.

    Seen in 2 reports
  46. Bind the reset token to the email address it was issued for and verify it server-side.

    Seen in 2 reports
  47. Expire OTPs after their stated lifetime and invalidate old codes when new ones are issued.

    Seen in 2 reports
  48. Do not rely on client-side checks or HTTP status codes for security decisions.

    Seen in 2 reports