A team ships MFA, tightens password rules, and still finds suspicious sign-ins beside duplicate checkout requests. The login form isn't necessarily broken. Attackers may be reusing leaked passwords, probing recovery, stealing sessions, or replaying requests that passed an earlier check.
The strongest login security best practices address those failures separately. MFA makes stolen passwords less useful. Rate limits constrain attempts. Recovery safeguards protect alternate entry points. Browser verification adds evidence about a protected action, while replay protection and idempotency prevent captured proofs and legitimate retries from creating unintended results.
The exposure is substantial: Verizon's 2025 Data Breach Investigations Report identified credential abuse as the leading initial attack vector, accounting for 22% of confirmed breaches in its analysis. That finding supports layered controls, not a claim that any particular product can prevent account compromise.
Three distinctions matter before changing production:
- Credential stuffing is an attack pattern using leaked username-password pairs.
- Account takeover is an outcome in which an attacker gains unauthorized account control.
- Session theft bypasses password entry by abusing an already authenticated session.
Engineering teams should map each control to its failure mode, test legitimate-user impact, and enforce changes route by route. A successful login alone doesn't establish that a subsequent recovery, reservation, checkout, or promotion redemption is authorized.
1. Require multi-factor authentication, preferring phishing-resistant methods
Multi-factor authentication (MFA) requires different kinds of proof, such as a password and possession of an authenticator. Its primary purpose is straightforward: a stolen password shouldn't be sufficient to enter an account.
Not all methods resist the same attacks. Authenticator-app codes can be captured by phishing sites and relayed during login. FIDO's passkey guidance explains how public-key credentials associated with the legitimate relying party provide phishing-resistant authentication, rather than exposing a reusable password to a look-alike site.
Enroll before enforcing
Synthetic example: A SaaS application requires passkeys for organization owners and supports authenticator-app codes for less privileged roles. Before enforcement, administrators enroll backup authenticators and document a recovery process requiring approval from another authorized administrator.
- Prioritize privileged access. Start with administrative accounts, ownership transfers, billing changes, and payout settings.
- Prepare recovery. Issue recovery codes during enrollment and store their hashes, not plaintext.
- Avoid weak fallbacks. SMS shouldn't be the only alternative for accounts that can move money or change ownership.
Passkeys reduce phishing exposure, but device loss and enrollment failures still need deliberate handling. Teams planning workforce deployment can consult the operational guidance on rolling out MFA in Microsoft 365, while keeping application-specific recovery and authorization policies separate.
2. Rate-limit login attempts per account, per device, and per network path
An IP-only limit fails when attackers rotate addresses. An account-only lockout creates another problem: attackers can deliberately prevent legitimate customers from signing in.
Rate limiting caps attempts over a time window. Effective login policies combine account identifiers, client or device signals, and network paths rather than trusting any individual signal. In SSO-provider telemetry analyzed by Verizon's credential-stuffing research, credential-stuffing attempts represented a median 19% of daily authentication attempts, illustrating why sustained automation deserves attention alongside obvious bursts.
Prefer progressive friction over permanent lockouts
Synthetic example: A SaaS login introduces increasing delays after repeated account failures and separately restricts clients attempting many distinct usernames. Initially, the policy records decisions without blocking requests, allowing engineers to identify shared corporate networks and retry-heavy mobile clients.
- Measure before enforcing. Record the proposed decision, affected route, and subsequent legitimate success.
- Separate identities. Use authenticated server identity where available; don't accept a client-supplied account identifier as trusted identity.
- Preserve recovery. Provide a controlled recovery path instead of trapping users behind an unexplained lockout.
The guide to layered rate limiting provides a useful companion for choosing enforcement keys. Rate limits constrain volume; they don't establish authorization or guarantee that a request hasn't already been processed.
3. Block credential stuffing with breached-password checks and anomaly signals
Credential stuffing uses credentials stolen elsewhere. Unlike password guessing against a single account, an attacker may test a plausible password against many accounts while distributing attempts across network addresses.
Breached-password screening removes some of that reusable material at enrollment and password change. NIST SP 800-63B emphasizes screening against commonly used or compromised values, secure hashed storage, and rate limiting rather than increasingly complicated password-composition rules.
Screen secrets without collecting more secrets
Teams should allow long passwords and passphrases, support password-manager paste, and reject known compromised values. A service such as Pwned Passwords can support a k-anonymity range lookup, where a partial hash identifies a group of possible matches without transmitting the complete password.
- Protect stored passwords. Use a suitable slow password-hashing scheme with unique salts, and benchmark its cost against production capacity.
- Group suspicious attempts. Look across accounts, clients, network infrastructure, failure patterns, and successful logins.
- Respond proportionately. Apply temporary stricter throttling or step-up authentication to affected traffic rather than forcing every customer through a reset.
Synthetic example: A monitoring review identifies widespread failures followed by successful logins from unfamiliar clients. The team requires additional authentication for those successful sessions and investigates related recovery changes.
The credential-stuffing attack guide explains the attack pattern in more detail. A compromised-password match is actionable evidence, but its absence doesn't establish that a password is safe or that the current requester is legitimate.
4. Verify the browser invisibly before high-value actions, instead of using CAPTCHAs
A scripted browser can submit valid credentials and follow familiar navigation paths. Password checks alone don't establish that a reservation, signup, or recovery request follows the expected protected flow.
Browser verification adds evidence about the browser environment and request integrity without requiring a puzzle or checkbox. MANDATE protects important website actions from automated abuse without CAPTCHAs: a browser script collects proof, and hosted server-side verification checks current server state before the application accepts the action.
Scope matters: Browser verification isn't proof of human identity, and it doesn't guarantee detection of every automated request.
Observe a specific action first
Synthetic example: A ticketing team instruments its reservation action and reviews grouped evidence in Observe mode. Engineers compare proposed decisions with completed legitimate reservations, support reports, and retry behavior before considering enforcement on that route.
Native Verify workflows currently observe. Enforcement plans therefore need to match the available integration and policy rather than assuming every workflow can already block requests.
- Keep secrets server-side. Server credentials belong on the server, and proof credentials must stay out of logs.
- Verify rather than parse. An opaque credential's presence isn't a successful verification result.
- Retain application controls. Authentication, permissions, tenant membership, transaction validation, and payment-provider checks remain necessary.
A challenge-free experience removes the puzzle, not the need for operational decisions. Verification unavailability, retries, and support escalation should be designed before a sensitive route is connected.
5. Use short-lived, single-use, and sender-bound proofs to prevent replay
A valid request can still be dangerous when submitted again. Replay occurs when an attacker captures an authentication message, token, or proof and reuses it outside its intended transaction.
NIST's current Digital Identity Guidelines distinguish replay resistance from phishing resistance and require a verifier to accept a given one-time password only once during its validity period. The practical lesson extends to action proofs: expiration alone isn't enough.
Bind proof to the intended transaction
A nonce is a fresh random value used to distinguish a transaction. A sender-bound proof also demonstrates possession of a client key, reducing the usefulness of a copied token where that architecture is supported.
- Bind the action. Validate the intended audience, account context, action, and relevant transaction identifier.
- Consume atomically. Check and mark the proof as used in the same atomic operation, so concurrent requests can't both succeed.
- Track shared state. Consumed identifiers must be visible across application instances and retained through the proof's validity window.
Synthetic example: A checkout service associates a proof with an order. On submission, it validates the current order state, consumes the proof, and records the transaction outcome.
If the response disappears during a network interruption, the client shouldn't blindly repeat a non-idempotent operation. A separate idempotency record should return the existing outcome, while replay monitoring distinguishes suspicious reuse from client retry bugs.
6. Protect sessions from theft with secure cookies, rotation, and timeouts
An attacker holding a valid session identifier may not need the password or another MFA prompt. Session theft therefore needs its own controls rather than being treated as another credential-stuffing variant.
Cookies should use Secure to restrict transmission to HTTPS and HttpOnly to prevent JavaScript from reading their contents. SameSite controls when browsers attach cookies to cross-site requests, but it doesn't replace explicit protection against cross-site request forgery.
Treat session changes as security events
Synthetic example: A financial application rotates session identifiers at sign-in and privilege elevation. A password or MFA reset invalidates other sessions, while a payout change requires fresh authentication.
- Set both timeout types. An idle timeout limits inactivity; an absolute timeout limits total session lifetime.
- Expose revocation. Let users inspect active sessions and revoke unfamiliar devices.
- Test invalidation. Confirm that revoked sessions stop working across application instances, caches, and background requests.
Shorter sessions reduce the period during which stolen credentials remain useful, but aggressive expiration can interrupt legitimate work. Teams should preserve unsent work where possible and avoid extending privileged sessions indefinitely.
The session-hijacking guide helps separate session compromise from password attacks. Cookie settings reduce exposure, but they don't repair an application that lets a valid session access another tenant's records or perform unauthorized actions.
7. Add risk-based step-up authentication for unusual sign-ins
Routine access and an ownership transfer shouldn't necessarily require the same authentication ceremony. Step-up authentication asks for fresh or stronger proof when the account context or requested action warrants it.
OWASP's Credential Stuffing Prevention Cheat Sheet recommends MFA as a central defense against password-based attacks and discusses layered controls. Selective step-up can reduce unnecessary friction, but only when teams understand the signals and maintain a safe recovery path.
A new location is a reason to assess risk, not proof that an attacker has taken over an account.
Combine context with action sensitivity
Synthetic example: A streaming service accepts routine access from a previously recognized device. When an unfamiliar device immediately attempts to change the account email, the service requires an enrolled authenticator and notifies the existing verified address.
- Document triggers. Record which combinations of device change, recovery history, session age, and action sensitivity require additional proof.
- Protect security settings. Require fresh authentication before changing email, phone, MFA methods, ownership, or payout details.
- Review failures. Track abandoned step-ups, unavailable authenticators, support escalations, and successful recovery.
Location and user-agent signals are imperfect. Traveling customers, privacy tools, and browser updates can change them legitimately, while attackers can imitate familiar values.
Step-up should increase assurance using an existing trusted authenticator. Sending a code to a newly supplied email address merely confirms access to the attacker-selected destination.
8. Design account recovery to resist takeover
A phishing-resistant login can still fail if support accepts an unverified recovery claim. The weakest supported recovery route may determine the account's effective protection.
NIST's July 2025 Digital Identity Guidelines added and clarified account-recovery requirements, including recovery following authenticator loss or theft and notification after recovery events. Recovery deserves a defined security ceremony, not an informal exception to authentication.
Separate recovery from emergency administration
Synthetic example: A customer who loses a device can recover using previously issued recovery codes or another enrolled authenticator. The application notifies established contact channels and delays sensitive contact changes according to its documented risk policy.
A support override follows a different path: authorized staff record the evidence, obtain independent approval, and leave an audit trail. Staff can't remove MFA just because a requester knows account details.
- Remove knowledge-based questions. Public or guessable personal information shouldn't authorize recovery.
- Constrain recovery credentials. Make links and codes short-lived, action-bound, and unusable after successful consumption.
- Notify established channels. Send notices to existing contacts, not just a replacement address supplied during recovery.
- Preserve assurance. Re-enrollment should restore the intended protection rather than leave the account on a weaker permanent fallback.
Recovery controls impose real usability costs, especially when customers lose every authenticator. Teams need a documented lost-access policy, an escalation owner, and explicit limits on what support can approve. An undocumented override isn't a recovery strategy.
9. Prevent account enumeration through consistent responses and timing
Different error messages can reveal account membership before an attacker guesses any password. Account enumeration means discovering which usernames or email addresses exist, often through sign-in, signup, or reset behavior.
Consistency needs to extend beyond visible wording. Response codes, redirects, response size, and timing can disclose the same information even when the page displays a generic error.
Test the entire flow
Synthetic example: A reset form responds that instructions will be sent if the address is eligible. For duplicate signup attempts, the application sends appropriate guidance to the existing account's verified address instead of exposing membership in the browser.
- Normalize login work. An unknown account can trigger a dummy password-hash verification using comparable hashing parameters.
- Queue email consistently. Keep delivery work outside the immediate response path so account-specific email processing doesn't create an obvious timing difference.
- Compare outcomes. Test known accounts, unknown accounts, locked accounts, and throttled requests.
- Limit abuse. Generic responses still need rate limits to prevent notification flooding and large-scale probing.
Exact timing equality isn't realistic across distributed systems. The practical objective is to remove reliable, repeatable differences while preserving useful internal diagnostics.
Membership privacy also creates a usability tradeoff: generic signup responses can confuse returning customers. Clear instructions delivered through an already verified channel can help without revealing account status to an unauthenticated requester.
10. Pair rate limits and idempotency with browser verification for protected actions
Browser verification, rate limits, and idempotency answer different questions. Treating them as alternatives leaves predictable gaps in checkout, reservation, and promotion flows.
Idempotency means repeating the same operation produces the same intended result rather than creating another side effect. An idempotency key identifies that operation across retries; it isn't an authorization credential or an automation signal.
- Browser verification adds evidence about the browser-originated action and its current server-side validity.
- Rate limits constrain how often an account or other trusted identity may perform an action.
- Idempotency prevents retries of the same operation from creating duplicate outcomes.
A reservation flow with distinct safeguards
Synthetic example: A ticketing application accepts a reservation request containing an idempotency key. It authenticates the account, checks eligibility and inventory, evaluates browser verification, and applies the account's active-hold policy before creating a hold.
The server stores the key with the authenticated identity, action, request hash, and outcome. A retry with the same payload returns the existing result; reuse with a different payload is rejected.
Implementation rule: Store the idempotency result and business state change atomically wherever possible. Otherwise, a crash can leave a completed action without a retrievable result.
Observe mode can measure browser-verification decisions before enforcement, while existing inventory and volume controls remain active. Payment-provider fraud tools still handle their own domain, and deliberate trial-eligibility abuse requires explicit eligibility rules rather than merely proving that a browser followed the expected flow.
How each login control addresses a specific attack and what it costs to run
| Item | Primary threat addressed | Main tradeoff | Standards or sources |
|---|---|---|---|
| Require multi-factor authentication, preferring phishing-resistant methods | Stolen or reused passwords | Adds enrollment and sign-in friction; recovery must be secure | FIDO2/WebAuthn; NIST SP 800-63B |
| Rate-limit login attempts per account, per device, and per network path | Online guessing and password spraying | Poorly tuned limits can block legitimate users | OWASP Authentication Cheat Sheet; NIST SP 800-63B |
| Block credential stuffing with breached-password checks and anomaly signals | Reuse of credentials exposed in other breaches | Breached-password lists miss new credentials; anomaly detection can flag legitimate activity | NIST SP 800-63B; OWASP credential stuffing guidance; Pwned Passwords |
| Verify the browser invisibly before high-value actions, instead of using CAPTCHAs | Automated abuse of browser-based actions | Does not prove human identity or stop all abuse; requires frontend and backend integration | MANDATE browser verification |
| Use short-lived, single-use, and sender-bound proofs to prevent replay | Reuse of captured requests, tokens, or proofs | Requires shared state and careful expiry and key management | OAuth 2.0 RFC 6749; DPoP RFC 9449 |
| Protect sessions from theft with secure cookies, rotation, and timeouts | Theft or misuse of valid session identifiers | Short timeouts can frustrate users; cross-device invalidation needs central session management | OWASP Session Management Cheat Sheet; RFC 6265 |
| Add risk-based step-up authentication for unusual sign-ins | Account takeover during risky sign-ins or sensitive actions | Risk rules can produce false positives and be difficult to explain | NIST SP 800-63B; OWASP account security guidance |
| Design account recovery to resist takeover | Abuse of recovery flows to bypass sign-in protections | Recovery safeguards can delay legitimate users who lose access | NIST SP 800-63B; OWASP Forgot Password Cheat Sheet |
| Prevent account enumeration through consistent responses and timing | Discovery of registered usernames or email addresses | Generic responses can reduce signup clarity; timing equalization adds some cost | OWASP Authentication and Forgot Password Cheat Sheets |
| Pair rate limits and idempotency with browser verification for protected actions | Excessive or duplicate reservations, checkouts, and redemptions | Requires limit tuning and idempotency storage; payment fraud controls remain separate | IETF Idempotency-Key draft; MANDATE browser verification |
Roll Out One Route at a Time, Starting With the Riskiest
A practical rollout begins with a route and a failure model, not a site-wide blocking switch. Administrative sign-in may prioritize phishing-resistant authentication and recovery; checkout may prioritize transaction authorization, replay resistance, and safe retry behavior.
For account entry, establish MFA and recovery safeguards first. Add layered rate limits, then validate replay handling and session invalidation before introducing browser-verification decisions in Observe mode. Existing authentication, authorization, and payment-provider controls should remain active throughout.
Define acceptance before enforcement
A team protecting sign-in should be able to explain what happens when verification succeeds, fails, times out, or returns an indeterminate result. An error must never become a successful verification, and any degraded-access policy needs an explicit owner.
The rollout review should cover:
- Legitimate-user impact. Compare completion, abandonment, recovery use, accessibility problems, and support contacts across affected flows.
- Attack evidence. Separate credential-stuffing attempts, replay rejections, suspicious session use, and signup automation rather than combining them into a generic bot count.
- Retry correctness. Test double-clicks, lost responses, concurrent submissions, and application restarts.
- Operational readiness. Document rollback, escalation, credential handling, and verification-unavailability behavior.
Metrics should describe both decisions and business outcomes. A rejected request isn't automatically a prevented takeover, and a successful verification isn't automatically an authorized purchase.
Exercise failure paths before expanding
A useful pre-enforcement exercise follows a legitimate customer through an interrupted request. The team verifies that a retry returns the existing result, an expired proof produces a recoverable response, and support can diagnose the event without accessing credentials.
A separate authorized test should attempt stale-proof reuse, cross-account idempotency-key reuse, recovery abuse, and account enumeration. Testing must stay within the authorization granted for the application and supporting services.
Only after those paths behave predictably should the team expand to another action. Policies may differ between account creation, recovery, reservations, and promotion redemption because their business rules and abuse incentives differ.
The durable approach is layered, route-specific control. Authentication establishes account access, authorization governs permissions, browser verification contributes action evidence, rate limits constrain volume, and idempotency protects processing correctness. None of those responsibilities disappears because another layer succeeds.
MANDATE offers invisible browser verification for sign-in, account creation, recovery, checkout, and other high-value website actions without CAPTCHAs. Visit MANDATE to evaluate an Observe-first rollout alongside existing MFA, recovery safeguards, rate limits, and idempotency controls.
