Safeguard
Security Guides•

How do you threat model a login feature with STRIDE?

Walk a login feature through STRIDE: credential stuffing, user enumeration, lockout abuse and session theft, each tied to a mitigation from OWASP guidance.

Safeguard Security Team
4 min read

Draw the login request, the credential store and the session, then ask the six STRIDE questions at each point. The usual findings are guessable credentials, account enumeration through error messages, lockout used as a weapon, and weak sessions. OWASP's authentication guidance gives a mitigation for each.

The diagram

Four elements are enough: the browser, the login endpoint, the credential store and the session store. Trust boundaries sit between the browser and the endpoint, and between the endpoint and the stores.

STRIDE walk through

STRIDELogin threatMitigation from OWASP guidance
SpoofingAttacker logs in as someone else with guessed or breached passwordsOffer MFA, screen against breached or common password lists, allow long passphrases
TamperingSession token altered or predictedMake sessions unique and very hard to predict; serve all authenticated pages over TLS
RepudiationFailed logins and lockouts go unnoticedLog and review authentication failures and lockouts
Information disclosureDifferent errors reveal which usernames existReturn one generic message, with consistent timing and status codes
Denial of serviceAttacker locks out real users on purposeAvoid lockouts that deny service to others; allow recovery while locked
Elevation of privilegeSession kept after a sensitive action or role changeInvalidate and rotate tokens after re-authentication

Details worth copying

The OWASP Authentication Cheat Sheet makes several specific points.

  • Enforce a minimum length and allow a maximum of at least 64 characters.
  • Do not impose composition rules, and do not force periodic changes. Rotate credentials when a leak is suspected.
  • Tie the failed login counter to the account, not only to the source address, so rotating addresses does not help an attacker.
  • Use rate limiting, a lockout threshold, an observation window and a lockout duration. Exponential delays are an option.
  • Treat CAPTCHA as defense in depth, possibly only after a few failures.

Record the decisions

For each row, record a response (mitigate, eliminate, transfer, accept), an owner and a test. Examples of tests: two wrong-user and wrong-password attempts return identical responses, the tenth failed attempt triggers the limit, and a session cookie is replaced after a password change.

Where login threat models go wrong

  • Modeling only the password form and forgetting recovery, which is often the weaker door. See the secure password reset flow checklist.
  • Ignoring logging, which means attacks happen unseen.
  • Treating MFA as a full answer when recovery can bypass it.

Try it yourself

Click through it at your own pace, or open it full screen. Click through it and look at how a code scan reports issues in the code behind a login handler.

Quick check

Should the lockout counter track the IP address?

OWASP advises tying it to the account, so that rotating source addresses does not evade it. Combine it with other limits and avoid lockouts that let an attacker block real users.

Do I still need password rules like symbols and numbers?

The OWASP guidance says not to impose composition rules. It recommends length, passphrase support and screening against breached or common passwords instead.

A note on tooling

Safeguard covers the code and dependency side of authentication work: SBOM and dependency scanning, reachability analysis and policy gates on pull requests. Try the free scan on the repository behind your login service.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.