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.
-
Rate-limit code generation as well as verification attempts.
Seen in 1 report
-
Return uniform responses for correct and incorrect codes and rate-limit per target email.
Seen in 1 report
-
Re-validate the OTP on the server instead of trusting the client response.
Seen in 1 report
-
Do not return the OTP in responses and derive identifiers from the session.
Seen in 1 report
-
Do not hardcode keys in client JavaScript and decide authentication server-side.
Seen in 1 report
-
Invalidate the activation code once 2FA is enabled.
Seen in 1 report
-
Require the current TOTP code before changing the 2FA secret or backup codes.
Seen in 1 report
-
Store 2FA enforcement state server-side, not in a swappable cookie value.
Seen in 1 report
-
Check that the 2FA step was completed on every subdomain.
Seen in 1 report
-
Request user verification and check the user verification flag server-side.
Seen in 1 report
-
Do not allow MFA self-enrolment for existing accounts without an out-of-band check.
Seen in 1 report
-
Notify the old address when the account email changes.
-
Generate verification tokens from long random values, not sequential numbers.
-
Re-check the new address when it is changed during verification.
Seen in 1 report
-
Medium
-
-
Make the disavow action actually disable the account or remove the email association.
Seen in 1 report
-
Check that the clicking account's email matches the invited address.
-
Do not return the invite key or link to the inviter.
Seen in 1 report
-
Verify ownership of an email address before showing tickets sent to it.
Seen in 1 report
-
Generate the auth secret server-side and bind it to a server session.
Seen in 1 report
-
Normalise whitespace consistently when validating and matching entity IDs.
Seen in 1 report
-
Check the Origin header on WebSocket connections and only trust configured OAuth providers.
Seen in 1 report
-
Verify the password confirmation on the server.
Seen in 1 report
-
Apply the reauthentication check to email add, confirm and make-primary actions.
Seen in 1 report
-
Require authentication and authorisation on the admin endpoint.
Seen in 1 report
-
Protect session cookies against theft and reuse.
Seen in 1 report
-
Invalidate the token server-side on logout.
Seen in 1 report
-
Rotate the session identifier when a guest authenticates to the room.
Seen in 1 report
-
$100 Medium
-
-
Protect federated shares with a password stored encrypted in the database.
Seen in 1 report
-
Authenticate deletion requests beyond the email From header.
Seen in 1 report
-
Require authentication for dashboard viewers.
Seen in 1 report
-
Do not expose staging webmail interfaces that receive reset emails.
-
Parameterise queries that use stored user-supplied names.
Seen in 1 report
-
Apply filename filtering recursively or use an allowlist.
Seen in 1 report
-
Sanitise user input before inserting it into templates.
Seen in 1 report
-
Require the current password and email verification for account state and email changes.
Seen in 1 report
-
Disable network selection from the lock screen and avoid MSCHAPv2 for computer authentication.
Seen in 1 report
-
Add CSRF protection, expire tokens after use, restrict referrers and block scripted SVG uploads.
Seen in 1 report
-
Check that the account still belongs to the organisation before issuing a reset.
-
Compare origins in the correct direction and reject null origins outright.
-
Stop returning the shared secret once enrolment is complete.
Seen in 1 report
-
Return a single generic error for failed logins and add rate limiting.
Seen in 1 report
-
Rate-limit the confirmation endpoint and return indistinguishable responses.
Seen in 1 report
-
Rate-limit Basic authentication attempts on WebDAV endpoints.
Seen in 1 report
-
Verify that the requester owns the account and phone number before sending codes or confirming identifiers.
Seen in 1 report
-
Restrict owners from changing member email addresses.
Seen in 1 report
-
Apply consistent Unicode normalisation when storing and comparing email addresses.
Seen in 1 report
-
Verify JWT signatures properly and handle the expiry claim correctly.
-
Generate a unique application secret per instance instead of shipping a fixed default.
Seen in 1 report
-
Reject empty identity identifiers.
Seen in 1 report
-
Use random session identifiers and add a second authentication factor.
Seen in 1 report