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.
-
Build reset links from a fixed configured domain rather than the request Host header.
Seen in 15 reports
-
Do not compare attacker-controlled values in a 2FA check; verify the code against a server-side secret.
Seen in 6 reports
-
Do not log credentials or request bodies in plaintext, and keep log files out of public directories.
Seen in 5 reports
-
Rate limit and lock out repeated one-time code guesses and keep codes valid for only a few minutes.
Seen in 4 reports
-
Invalidate old passwords, login QR codes, pending sessions and remember-me tokens when the password changes.
Seen in 4 reports
-
Revoke or re-authenticate existing sessions when 2FA is enabled.
Seen in 4 reports
-
Revoke all other sessions on password change and logout.
Seen in 4 reports
-
Set an expiry on session cookies and regenerate the identifier on login, logout and password reset.
Seen in 4 reports
-
Use a random single-use token with a server-enforced expiry, and require authentication for admin resets.
Seen in 4 reports
-
Enforce rate limiting and account lockout on OTP verification.
Seen in 4 reports
-
Require email verification before granting access and check for existing accounts during OAuth signup.
Seen in 4 reports
-
Publish a strict SPF record with a hard fail instead of a soft fail.
Seen in 3 reports
-
Require re-verification of any new email address.
Seen in 3 reports
-
Enforce rate limiting and account lockout on failed logins.
Seen in 3 reports
-
Require email verification before linking social accounts, and use a random single-use token that is not the user identifier.
Seen in 3 reports
-
Verify the new phone number before applying it and check that the email address is verified before enabling two-factor.
Seen in 3 reports
-
Do not trust client-supplied flags to skip second-factor validation, and enforce rate limiting and lockout.
Seen in 3 reports
-
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
-
Enforce the verification result server-side and never accept a fixed default code.
Seen in 3 reports
-
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
-
Invalidate reset tokens after use and when a new token is generated.
Seen in 3 reports
-
Do not accept default or hard-coded OTP values.
Seen in 3 reports
-
Invalidate all sessions on password change and logout.
Seen in 3 reports
-
Require verification of the new email address before updating it.
Seen in 3 reports
-
Verify that the email from the OAuth provider matches the existing account's email before linking.
Seen in 3 reports
-
Use a strong signing secret and verify the token signature and claims.
Seen in 3 reports
-
Enforce the second factor on all authentication paths, including signup and OAuth linking.
Seen in 3 reports
-
Bind the reset token to the account it was issued for and ignore client-supplied user identifiers.
Seen in 3 reports
-
Normalise and compare email addresses consistently across registration and recovery, and do not strip special characters during recovery.
-
Generate a fresh 2FA secret for each setup attempt instead of reusing a stored one.
-
Send reset tokens only to the user's email and never return them in the response body.
-
Check that the caller is allowed to change another user's email and require verification before binding a login.
-
Invalidate login and session state tied to the old email when the account email changes.
-
Rate limit and lock out repeated guesses of the current password.
-
Invalidate all reset tokens when the password changes, however the change was made.
Seen in 2 reports
-
Bind password changes to the authenticated session and ignore client-supplied identifiers.
Seen in 2 reports
-
Use short OTP expiry and enforce rate limiting and lockout.
-
Do not link OAuth identities by email without verifying ownership and consent.
Seen in 2 reports
-
Publish a valid SPF record for the domain.
Seen in 2 reports
-
Bind the state to the session and reject non-default response type and mode values.
Seen in 2 reports
-
Critical -
Medium
-
-
Invalidate sessions created before the last password change.
Seen in 2 reports
-
Validate the reset key before changing the password.
-
Rate-limit the first step and enforce the flow steps server-side rather than by referer.
Seen in 2 reports
-
Verify that the user ID and email in the update request belong to the authenticated user.
Seen in 2 reports
-
Require ownership verification for email changes and restrict role attribute changes.
-
Revoke sessions across all related dashboards on logout and do not auto-login after logout.
-
Use the email address stored for the account instead of a user-supplied email address.
-
Bind the reset token to the email address it was issued for and verify it server-side.
Seen in 2 reports
-
Expire OTPs after their stated lifetime and invalidate old codes when new ones are issued.
-
Do not rely on client-side checks or HTTP status codes for security decisions.