Security

Threat modeling at the design stage

Updated November 19, 2026

To threat model at the design stage, answer four questions about one feature before it is built: what are we working on, what can go wrong, what are we going to do about it, and did we do a good enough job. Draw the data flows, apply the six STRIDE prompts to each element, choose a response to every threat, turn the responses into requirements, and have someone who did not design it review the result. NIST SP 800-218 tasks PW.1.1, PW.1.2 and PW.2.1 ask for exactly this and for the records. This page works one small feature through all four questions. Read November 19, 2026.

Stage 2 of 7

Design in the Stage Map

5 controls. SSDF tasks at this stage:

PW.1.1PW.1.2PW.1.3PW.2.1PW.4.1PW.4.2

Open this stage on the Stage Map

What the design stage has to produce

SP 800-218 v1.1 puts the design stage in practices PW.1 and PW.2. The tasks, in plain words, with who does them and what is left behind:

SSDF taskWhat it asksOwnerEvidence
PW.1.1Use risk modeling (threat modeling, attack modeling or attack surface mapping) to assess the security risk of the software. Examples in the task: train security champions, do more rigorous assessments for high-risk areas such as authentication and credential management, and classify the data the software handlesFeature team, with a security champion or risk modeling expertThe model: diagram, elements, threats
PW.1.2Track security requirements, risks and design decisions: record the response to each risk, the rationale for any exception, and re-evaluate approved exceptions periodicallyFeature team leadDecision records, exception records, requirements linked to the work
PW.1.3Where appropriate, build in standard security features and services (logging, identity, access control) instead of writing your ownArchitectDesign notes naming the shared services used
PW.2.1Have a qualified person who was not involved in the design, or automated processes in the toolchain, review the design against the security requirements and risk information, and record the findingsReviewer outside the design team (architect, AppSec engineer)Design review record in the specification, tracker or the model itself

The SSDF task descriptions pick authentication and credential management as an example of a high-risk area that deserves the more rigorous assessment. That is why the feature below is a good candidate: a password reset sits in that category.

The four questions, applied

The Threat Modeling Manifesto reduces the activity to four questions (its group credits them to Adam Shostack's four question frame), and OWASP's cheat sheet builds its four steps on them. The Manifesto is methodology-agnostic: it states values and principles rather than a procedure. This is how the questions turn into work:

QuestionWhat the team doesWhat you record
What are we working on?Draw a data flow diagram (DFD) or comparable model showing trust boundaries, data flows, data stores, processes and external entitiesThe diagram, in a file the team can update, plus the data classification
What can go wrong?Apply the STRIDE prompts (Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege) to each element, flow and boundary, and brainstormA threat list tied to elements
What are we going to do about it?Choose a response for each threat: mitigate, eliminate, transfer or accept (the four responses OWASP's cheat sheet lists from Shostack)The response, the requirement it creates, and the owner
Did we do a good enough job?Review with stakeholders beyond the development and security teams: does the diagram match the system, does every threat have a response, can each mitigation be testedReview record and open findings

OWASP also says the model is not done once: it should be maintained and updated alongside the system, and it should be a standard step in the team's process rather than an add-on. The Manifesto adds that modeling follows design changes in iterations each scoped to a manageable portion of the system. A feature-sized model, as below, fits that.

The feature: password reset by email link

This is an example feature chosen for its size. A user who forgot their password enters an email address. If an account has that address, the service creates a one-time reset token, stores a record of it, and emails a link. The user opens the link, enters a new password, and the service saves it and sends a confirmation email. Credentials are the highest-sensitivity data here, so the team gives the feature the more rigorous assessment PW.1.1 describes, and targets ASVS Level 2 (see requirements for the matching requirement set R1 to R11).

Elements (the diagram, written as lists)

IDTypeElementNotes
E1External entityThe user's browserUntrusted
E2External entityMail provider and the user's mailboxOutside the team's control
P1ProcessReset service (API)Handles both requests
P2ProcessMail workerSends emails from a queue
D1Data storeAccount storeHolds password hashes
D2Data storeReset token storeHolds token records, not tokens (decision in T3)
D3Data storeAudit logSecurity events

Data flows

IDFrom toCarries
F1E1 to P1Email address (reset request)
F2P1 to D2Token record: hash of token, account reference, expiry, used flag
F3P1 to P2Request to send a reset email
F4P2 to E2Email with the reset link
F5E2 to E1Delivery to the user's mailbox, then the user opens the link
F6E1 to P1Token and new password
F7P1 to D2Look up and consume the token
F8P1 to D1New password hash
F9P1 to D3Audit events
F10P1 to P2Request to send the confirmation email

Trust boundaries: TB1 between the internet (E1) and the team's service; TB2 between the service and the mail provider (E2). Everything on F5 is outside the team's boundary, which matters for T4.

What can go wrong, and what the team does about it

The team applied all six STRIDE prompts to every element and flow and kept the threats that made sense. STRIDE, in Microsoft's definitions: spoofing is using another user's authentication information; tampering is malicious modification of data; repudiation is denying an action when nothing can prove otherwise; information disclosure is exposure to those not meant to have it; denial of service denies service to valid users; elevation of privilege is gaining access beyond what was granted. Threats are written as conditions the design must withstand, not as steps. Responses use OWASP's four options. ASVS references are to 5.0.0.

IDWhereSTRIDEWhat can go wrongResponse and the requirement it createsHow it is verified
T1F1, P1Information disclosureThe reply tells a caller whether an address has an accountMitigate: same message and similar response time for known and unknown addresses (ASVS 6.3.8, L3; OWASP Forgot Password Cheat Sheet). R6Automated test compares the two responses
T2F6, P1SpoofingSomeone other than the account owner completes a reset with a token that was reused, guessed or taken from somewhere it should not beMitigate: token from a secure random source, long enough, single use, expiring, linked to one account (OWASP Forgot Password Cheat Sheet; ASVS 6.4.1 by analogy; 128 bits is the bar ASVS 7.2.3 sets for session tokens, used here as the team's choice). R2Unit tests for single use and expiry; design review of generation
T3D2Information disclosureRead access to the token store gives usable tokensMitigate: the store holds a hash, never the token; access limited to P1 (OWASP: tokens stored securely). Decision D-3Review of the schema and database permissions
T4F4, F5, E2Information disclosureThe link reaches someone other than the owner (compromised mailbox), or leaks through logs or a referring pageMitigate what the team controls: HTTPS link built from a configured address, not from request headers; no-referrer policy on the reset page; no token in logs (ASVS 16.2.5). Accept the rest: the mailbox is outside TB2, so the team shortens the lifetime, notifies the user on completion (ASVS 6.3.7) and ends other sessions (T9). Residual risk owner: product ownerHeader and log checks in test; the acceptance is recorded as decision D-4
T5P1Elevation of privilegeA reset gets around the second factor the account has enabledMitigate: reset does not bypass MFA (ASVS 6.4.3, L2). R1Test with an MFA-enabled account
T6F1, P2Denial of serviceRepeated requests flood a user's inbox, exhaust the mail queue, or lock out the real ownerMitigate: per-account and per-source limits; a request never locks or changes the account (OWASP Forgot Password Cheat Sheet; ASVS 2.4.1, 6.1.1). R5Documented limit exists; test shows it applies
T7F6, P1TamperingThe steps of the flow are performed out of order or skippedMitigate: the server enforces the sequence for the same user (ASVS 2.3.1, L1). R4Test calls the final step without a valid token
T8F9, D3RepudiationAfter a disputed takeover nobody can show who requested or completed a resetMitigate: log request, token issue, token use and password change with who, what, when (UTC), and keep logs protected (ASVS 16.3.1, 16.2.1, 16.4.2). R10Log review in test; logs go to a separate system
T9P1Elevation of privilegeSessions open before the reset stay valid afterwardMitigate: end other sessions automatically (ASVS 7.4.3 requires offering the option at L2; the team chooses the stricter default). R9Test: older sessions fail after reset
T10P1, support toolingElevation of privilegeA support or admin path can set a user's password, so insiders know itEliminate: no such path; support can start a reset but not choose the password (ASVS 6.4.6, L3). R11Design review of support tooling

Two further items belong in the record without a number of their own. Availability: if the mail provider is down, users cannot reset, so the design keeps a support route where staff verify identity (OWASP: a user must always have a way to recover the account). Level: ASVS 6.3.6 (Level 3) says email is not used as an authentication mechanism, so a Level 3 target would force a different design; at Level 2 the email link stays and the team records that choice.

What gets recorded

PW.1.2 asks you to record the response to each risk, how mitigations are achieved, and the rationale for any approved exception, and to keep these for auditing and maintenance throughout the life cycle. A decision record can be this short (an example):

D-4  Mailbox compromise (T4)
Status: accepted with compensating controls
Context: the reset link travels over F5, outside our boundary (TB2).
Decision: keep email link at ASVS L2; 30 minute lifetime (example value),
  notification on completion, other sessions ended, no token in logs.
Residual risk: a compromised mailbox can still receive a valid link in time.
Owner: product owner. Review: yearly, or on any change to the channel.

Store the model with the code (the diagram as a file, the threat list as a table in the same repository or design document), link each response to a requirement ticket, and link each test to the threat it covers. The design review (PW.2.1) is the second record: a qualified person who did not design the feature checks the design against the requirements and the risk information. Reviewing the risk model itself is one of the task's examples: does it seem to identify the risks adequately? Findings go in the specification, the issue tracker or the model. If the requirements cannot be met, the task's own example says to change the design or the risk response.

The review: did we do a good enough job?

The reviewer uses the questions OWASP lists for the validation step:

  1. Does the DFD accurately reflect the system as it will be built?
  2. Have all threats been identified, including the ones this team tends to miss?
  3. Does every threat have an agreed response?
  4. Where mitigation was chosen, does it bring the risk to an acceptable level?
  5. Is the model documented and stored where those who need it can read it?
  6. Can each mitigation be tested, so that success or failure can be measured?

Question 6 is where design meets the next stages: every mitigation in the table above has a "how it is verified" entry that becomes a test in the test stage, a check in code review (see the coding stage), or a release gate condition.

How much time it takes and when to redo it

No standard publishes a time figure, because the effort depends on the size of the feature and the team's skill. As a planning example (not a measured value): one session of about an hour for a feature this size, with the diagram drafted beforehand by the person who knows the flows, and a short review afterwards by someone who was not in the room. Scope each model to one feature or one flow; the Manifesto asks for iterations scoped to manageable portions, and OWASP names the typical barrier to doing it at all: tight schedules and too little security training. Inviting security specialists to the sessions and training the team are the remedies it lists.

Redo or amend the model when the design changes. For this feature that means adding a new delivery channel such as SMS, adding a new way to prove identity, moving the token store, or changing who can start a reset. Also revisit it when the periodic review of approved exceptions comes due (PW.1.2), or after a vulnerability in released software shows the model missed something (the root cause step in operate and respond).

Who does what

RoleDoesOutput
Feature team (lead and developers)Draws the diagram, proposes responses, builds mitigations, writes the testsModel, requirements, tests
Security champion or AppSec engineerFacilitates, adds threats the team missed, checks that responses are testableReviewed threat list
Reviewer outside the design teamPerforms the PW.2.1 reviewDesign review record
Product ownerAccepts residual risk and approves exceptionsDecision records
Platform or shared services ownerProvides the standard services PW.1.3 prefers (logging, identity, rate limiting)Service interfaces and configuration

The tasks used here are listed in full on the SSDF page, and the earlier stage that sets the requirements this model checks is security requirements.

Questions people ask

What are the four questions of threat modeling?

What are we working on, what can go wrong, what are we going to do about it, and did we do a good enough job. They appear on the Threat Modeling Manifesto site and are the basis of OWASP's four steps: system modeling, threat identification, response, and review.

When in the SDLC should you threat model?

Early, at the design stage, and again whenever the design changes. OWASP says threat modeling is ideally performed early in the SDLC, such as during design, and that the model should be maintained and updated alongside the system.

Sources

  1. NIST SP 800-218, Secure Software Development Framework (SSDF) Version 1.1, read November 19, 2026
  2. Threat Modeling Manifesto, read November 19, 2026
  3. OWASP Threat Modeling Cheat Sheet, read November 19, 2026
  4. Microsoft Threat Modeling Tool: STRIDE model, read November 19, 2026
  5. OWASP Forgot Password Cheat Sheet, read November 19, 2026
  6. OWASP ASVS 5.0.0, chapters V2, V6 and V7, read November 19, 2026
  7. OWASP ASVS 5.0.0, chapter V16 Security Logging and Error Handling, read November 19, 2026

Last reviewed November 19, 2026