# Threat modeling at the design stage

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 19 Nov 2026.

## 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 task | What it asks | Owner | Evidence |
|---|---|---|---|
| PW.1.1 | Use 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 handles | Feature team, with a security champion or risk modeling expert | The model: diagram, elements, threats |
| PW.1.2 | Track security requirements, risks and design decisions: record the response to each risk, the rationale for any exception, and re-evaluate approved exceptions periodically | Feature team lead | Decision records, exception records, requirements linked to the work |
| PW.1.3 | Where appropriate, build in standard security features and services (logging, identity, access control) instead of writing your own | Architect | Design notes naming the shared services used |
| PW.2.1 | Have 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 findings | Reviewer 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:

| Question | What the team does | What 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 entities | The 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 brainstorm | A 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 tested | Review 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](/stages/requirements/) for the matching requirement set R1 to R11).

**Elements** (the diagram, written as lists)

| ID | Type | Element | Notes |
|---|---|---|---|
| E1 | External entity | The user's browser | Untrusted |
| E2 | External entity | Mail provider and the user's mailbox | Outside the team's control |
| P1 | Process | Reset service (API) | Handles both requests |
| P2 | Process | Mail worker | Sends emails from a queue |
| D1 | Data store | Account store | Holds password hashes |
| D2 | Data store | Reset token store | Holds token records, not tokens (decision in T3) |
| D3 | Data store | Audit log | Security events |

**Data flows**

| ID | From to | Carries |
|---|---|---|
| F1 | E1 to P1 | Email address (reset request) |
| F2 | P1 to D2 | Token record: hash of token, account reference, expiry, used flag |
| F3 | P1 to P2 | Request to send a reset email |
| F4 | P2 to E2 | Email with the reset link |
| F5 | E2 to E1 | Delivery to the user's mailbox, then the user opens the link |
| F6 | E1 to P1 | Token and new password |
| F7 | P1 to D2 | Look up and consume the token |
| F8 | P1 to D1 | New password hash |
| F9 | P1 to D3 | Audit events |
| F10 | P1 to P2 | Request 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.

| ID | Where | STRIDE | What can go wrong | Response and the requirement it creates | How it is verified |
|---|---|---|---|---|---|
| T1 | F1, P1 | Information disclosure | The reply tells a caller whether an address has an account | Mitigate: same message and similar response time for known and unknown addresses (ASVS 6.3.8, L3; OWASP Forgot Password Cheat Sheet). R6 | Automated test compares the two responses |
| T2 | F6, P1 | Spoofing | Someone other than the account owner completes a reset with a token that was reused, guessed or taken from somewhere it should not be | Mitigate: 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). R2 | Unit tests for single use and expiry; design review of generation |
| T3 | D2 | Information disclosure | Read access to the token store gives usable tokens | Mitigate: the store holds a hash, never the token; access limited to P1 (OWASP: tokens stored securely). Decision D-3 | Review of the schema and database permissions |
| T4 | F4, F5, E2 | Information disclosure | The link reaches someone other than the owner (compromised mailbox), or leaks through logs or a referring page | Mitigate 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 owner | Header and log checks in test; the acceptance is recorded as decision D-4 |
| T5 | P1 | Elevation of privilege | A reset gets around the second factor the account has enabled | Mitigate: reset does not bypass MFA (ASVS 6.4.3, L2). R1 | Test with an MFA-enabled account |
| T6 | F1, P2 | Denial of service | Repeated requests flood a user's inbox, exhaust the mail queue, or lock out the real owner | Mitigate: 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). R5 | Documented limit exists; test shows it applies |
| T7 | F6, P1 | Tampering | The steps of the flow are performed out of order or skipped | Mitigate: the server enforces the sequence for the same user (ASVS 2.3.1, L1). R4 | Test calls the final step without a valid token |
| T8 | F9, D3 | Repudiation | After a disputed takeover nobody can show who requested or completed a reset | Mitigate: 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). R10 | Log review in test; logs go to a separate system |
| T9 | P1 | Elevation of privilege | Sessions open before the reset stay valid afterward | Mitigate: end other sessions automatically (ASVS 7.4.3 requires offering the option at L2; the team chooses the stricter default). R9 | Test: older sessions fail after reset |
| T10 | P1, support tooling | Elevation of privilege | A support or admin path can set a user's password, so insiders know it | Eliminate: no such path; support can start a reset but not choose the password (ASVS 6.4.6, L3). R11 | Design 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](/stages/test/), a check in code review (see the [coding stage](/stages/code/)), or a [release gate](/security-gates/) 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](/stages/operate/)).

## Who does what

| Role | Does | Output |
|---|---|---|
| Feature team (lead and developers) | Draws the diagram, proposes responses, builds mitigations, writes the tests | Model, requirements, tests |
| Security champion or AppSec engineer | Facilitates, adds threats the team missed, checks that responses are testable | Reviewed threat list |
| Reviewer outside the design team | Performs the PW.2.1 review | Design review record |
| Product owner | Accepts residual risk and approves exceptions | Decision records |
| Platform or shared services owner | Provides 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](/ssdf/), and the earlier stage that sets the requirements this model checks is [security requirements](/stages/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

- [NIST SP 800-218, Secure Software Development Framework (SSDF) Version 1.1](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-218.pdf), read 2026-11-19
- [Threat Modeling Manifesto](https://www.threatmodelingmanifesto.org/), read 2026-11-19
- [OWASP Threat Modeling Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Threat_Modeling_Cheat_Sheet.html), read 2026-11-19
- [Microsoft Threat Modeling Tool: STRIDE model](https://learn.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats), read 2026-11-19
- [OWASP Forgot Password Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Forgot_Password_Cheat_Sheet.html), read 2026-11-19
- [OWASP ASVS 5.0.0, chapters V2, V6 and V7](https://github.com/OWASP/ASVS/tree/v5.0.0_release/5.0/en), read 2026-11-19
- [OWASP ASVS 5.0.0, chapter V16 Security Logging and Error Handling](https://github.com/OWASP/ASVS/blob/v5.0.0_release/5.0/en/0x25-V16-Security-Logging-and-Error-Handling.md), read 2026-11-19

Last reviewed: 2026-11-19

Canonical: https://sdlcsecurity.com/stages/design/
