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.
-
Use distinct signing secrets per application and consistent user ID mappings, and mark the remember_token cookie HttpOnly.
-
Key the rate limiter on the real connection IP, not on a client-supplied X-Forwarded-For header.
Seen in 1 report
-
Add an attempt limit or lockout to the one-time code check, and do not expose admin identities in public repositories.
-
Add proper authorisation checks and rate limiting on the confirmation code to prevent user enumeration and brute-force.
Seen in 1 report
-
Do not trust a client-supplied parameter to decide whether to generate and send a new password; verify that the request came from the account owner.
Seen in 1 report
-
Verify that the user completing the setup is the same user who initiated the installation, and do not rely on a sequential installation_id.
Seen in 1 report
-
Use a high-entropy reset code that expires, and key the rate limit on more than the client IP.
-
Bind the email change confirmation token to the specific email address and user.
Seen in 1 report
-
Restrict which parameter names are accepted and do not concatenate user-supplied query parameters into the server's own query.
Seen in 1 report
-
Verify the identity token and use the email from Facebook's response instead of a client-supplied email parameter.
Seen in 1 report
-
Use distinct JWT signing secrets per environment so tokens are isolated.
Seen in 1 report
-
Verify the identity from Google's token instead of trusting a client-controlled email parameter in the OAuth callback.
Seen in 1 report
-
Maintain a revocation list or token blacklist so JWTs are not accepted after logout.
Seen in 1 report
-
Enforce rate limiting on verification attempts and do not rely on a client-side success flag.
-
Check that the caller is the user identified in the URL path before issuing a token.
Seen in 1 report
-
Add rate limiting to the backup code verification endpoint.
Seen in 1 report
-
Bind the email change token to the specific email address it was issued for.
-
Do not trust client-supplied email parameters in OAuth flows; derive the email from the verified token.
Seen in 1 report
-
Fix CORS misconfigurations on the CAPTCHA endpoint and use more complex challenges.
-
Require a cryptographic signature proving ownership of the wallet address.
Seen in 1 report
-
Do not reference unclaimed accounts or domains in documentation.
Seen in 1 report
-
Remove expired email domains from contributor accounts.
-
Do not execute CI jobs for other merge requests when a source branch is deleted.
Seen in 1 report
-
Restrict SMS relay programs to prevent reading other users' OTPs.
Seen in 1 report
-
Protect session tokens from theft and allow users to revoke sessions.
Seen in 1 report
-
Avoid revealing account existence on the password reset page and prevent lockout abuse.
Seen in 1 report
-
Enforce authorization checks on purchase order endpoints.
Seen in 1 report
-
Invalidate all recovery codes when two-factor authentication is disabled or re-enabled.
Seen in 1 report
-
Enforce the password constraint regardless of the SSO flag and add authorisation checks to user lookup queries.
-
Use a long random invitation token and rate limit acceptance attempts.
Seen in 1 report
-
Generate the login challenge server-side and bind it to the email address that requested it.
-
Generate invitation tokens from a cryptographically secure random source rather than an Object ID.
-
Do not set the reply-to header to the inviter's address on invitation emails.
Seen in 1 report
-
Validate the callback URL against an allowlist of the application's own domains.
Seen in 1 report
-
Do not trust a client-side cookie for admin access, and restrict uploaded file types and execution.
Seen in 1 report
-
Issue a new session identifier after authentication and add shared parent domains to the Public Suffix List.
-
Require a recent MFA claim for all security info changes and restrict which client identifiers may update sign-in methods.
Seen in 1 report
-
Normalise email addresses to a single case before creating accounts and issuing tokens.
Seen in 1 report
-
Normalise and strictly validate email addresses at registration.
Seen in 1 report
-
Bind the state parameter to the user's session and require explicit confirmation.
-
Require the second factor after a password reset before granting access.
Seen in 1 report
-
Do not embed encryption keys in the app and do not derive the authentication secret from predictable values.
Seen in 1 report
-
Reject combined response types and require a valid state on the callback.
-
Require email verification before allowing login and do not trust unverified accounts in the OAuth flow.
Seen in 1 report
-
Authenticate devices with secrets that cannot be obtained from the local network, and revoke old keys on re-registration.
-
Require a user action that email gateways cannot perform before verifying an address.
-
Do not expose the verification token in the page URL.
Seen in 1 report
-
Use exact hash comparison, restrict invitations without a room, and validate configured binary paths.
-
Normalise and validate internationalised domain characters in email addresses.
Seen in 1 report
-
Rate limit on server-side values and normalise email case before counting requests.
Seen in 1 report