What is threat modeling? Find attack paths in system flows and turn them into mitigations
Threat modeling is a repeatable analysis in which a team examines how a system works and moves data, describes ways an attacker could abuse it, and decides what to do about those paths. A scanner looks for classes of problems in implemented code; threat modeling asks earlier in design, “What could happen if this boundary or permission is wrong?” Its useful output is not just a list of threats, but work with owners, implementation and verification steps, and any accepted residual risk.
What problem does it solve?
Feature requirements usually describe normal use. Security design must also consider a user changing a permission, replaying a request, substituting another organization’s resource ID, or an external service responding unexpectedly. Threat modeling examines system components and data flows from an adversary’s perspective so that these failure paths can be addressed before the design and implementation harden.
OWASP describes threat modeling as a structured, repeatable process for modeling a system from a security perspective, identifying threats that fit that model, and determining responses. It is not a document to write once before launch and then file away. Revisit the model when data flows, authorization boundaries, external integrations, or deployment assumptions change. Instead of requiring the same meeting for every edit, identify changes that alter risk and update the analysis to a proportionate depth.
How do you define the system boundary?
Start with one or two sentences about what is being built or changed. Record the users, data and capabilities to protect, related systems, and what is out of scope. This keeps the discussion from expanding into an unbounded review of “the whole service.” Then trace how a user sends a request and how data is processed, stored, or passed outside the system.
A data-flow diagram (DFD) is a common way to show these relationships. Even a simple sketch should distinguish external actors, processing components, data stores, and directions of data movement, and should mark trust boundaries. A trust boundary is where authentication, ownership, authorization, or network zone changes, so input or permission may need to be checked again. A team can start with a table or whiteboard if diagramming is a barrier. The key is to understand who sends what data, to which component, and with what authority.
Suppose a multi-organization project service is adding a team invitation feature. A bounded scope might be: “An administrator sends an email invitation; when the recipient accepts it, they join a project in that organization.” The model includes the administrator’s browser, web/API server, database holding invitations, email service, external recipient, and sign-in service. Draw requests from browser to server, invitation data between server and database, messages to the email service, and the link the recipient opens. Mark the organization boundary and the external email-service boundary; these reveal where authorization must be checked.
How can a team find relevant threats?
After modeling the system, ask of each component and flow: “Who could abuse this, and which asset or user would be affected?” STRIDE is one set of six prompts for generating threats. It is not a mandatory standard; threat-modeling methods vary with the system and organization.
| STRIDE prompt | Meaning | Question for the invitation feature |
|---|---|---|
| Spoofing | Can an attacker act as another user or component? | How do we establish that the person with the link is the user at the invited email address? |
| Tampering | Can a request or stored/transmitted data be changed without permission? | Could someone change the organization ID or assigned role in the request to expand invitation authority? |
| Repudiation | Is there too little evidence to determine who performed an important action? | Can creation, cancellation, and acceptance be tied to an actor and organization? |
| Information disclosure | Could someone without permission read data or obtain a secret? | Could the invitation token or another organization’s information appear in a link, error, or log? |
| Denial of service | Could an attack reduce availability for legitimate users? | Could repeated invitations exhaust mail quotas or disrupt the service? |
| Elevation of privilege | Could a lower-privileged user perform a higher-privileged action? | Could a regular member create an administrator-only invitation or become an administrator merely by accepting one? |
STRIDE is a starting point, not a completeness guarantee. Connect each prompt to actual components, data, and boundaries. If a category does not apply, record why; add important risks such as business-logic abuse, supply-chain paths, or operational access separately. “We have authentication” is not enough: identify which user may perform which action on which resource, and whether that authority is checked consistently on both sides of each boundary.
How do you prioritize threats and turn them into work?
Describe each threat as a concrete path and impact. For example: “If an attacker changes the organization ID in the request, they can create invitations in another organization, causing cross-tenant authorization failure.” Consider existing controls, the conditions an attacker needs, exposure that affects likelihood, scope of impact, and uncertainty. Avoid invented precision from arbitrary scores. If the organization has a risk scale, record its rationale; otherwise explain the relative priority and why.
Responses can include eliminating the risk, mitigating it, transferring it, or explicitly accepting it. If risk is accepted, an authorized decision-maker should record the reason and conditions for review. Replace vague actions such as “add logging” with specifics: where to record an action, which sensitive values to exclude, and who will review an alert. Put a mitigation in a ticket or backlog with its linked threat, owner, completion condition, and test. The analysis is useful only if the team can check that the implemented change reduced the risk.
For the hypothetical invitation feature, work might look like this:
| Threat scenario | Possible response | Verification |
|---|---|---|
| Change the organization identifier and create an invitation in another organization | Have the server check the signed-in user’s administrator authority and membership in the target organization on every request; do not trust only a client-supplied organization value | Test that an unauthorized user’s request with another organization ID is rejected and creates or reveals no other organization’s data |
| A forwarded invitation link or a token in logs/analytics is used by someone else | Limit link lifetime and use; recheck the recipient account, target organization, and role on acceptance; keep secrets out of logs | Check used and expired links, acceptance by another account, and logs or errors containing the token |
| A modified role parameter grants administrator access | Enforce allowed roles in server policy and compare the inviter’s authority with the role being granted | Verify that elevated, missing, or altered client role values are rejected |
| Repeated sends exhaust mail resources or quotas | Consider per-user or per-organization rate limits, duplicate handling, monitoring, and an operational response | Confirm expected responses and alerts at the limit and recovery for normal invitations |
This is an illustrative design example, not a universal recipe. Select controls for the actual token design, authentication, invitation policy, email provider, and business or legal requirements.
When should you revisit the model?
Revisit it when boundaries or assumptions change: for example, when adding an external API, data store, or administrative capability; changing authentication or authorization; moving sensitive data; or learning of an attack or incident that challenges an assumption. A full analysis need not be repeated for a small change that does not affect data flow or authority. Connect the work to a change ticket: ask about security impact and update the relevant model when the answer warrants it.
Record the scope and assumptions, reviewed flows and boundaries, prioritized threats, existing controls and new actions, owners and verification status, and accepted residual risks. Leave enough context for the next person to understand and reopen the decision. Reproducible paths and observable results are more useful than blame or an unsupported statement that the system is “safe.”
Can threat modeling find vulnerabilities by itself?
No. Threat modeling identifies design-level attack paths and controls; it does not prove that the implementation contains or lacks a defect. NIST IR 8397 recommends threat modeling for design-level security issues while also listing other techniques, including automated and static tests, fuzzing, and web application scanners. Check the model’s conclusions through code review, authorization and negative tests, analysis tools, and operational monitoring. Conversely, a clean scanner result does not show that a design has no authorization-abuse path.
Judge a threat model by whether its scenarios fit the actual system, its mitigations can be implemented, and the results can be verified—not by the size of its diagram or number of findings. Bound the scope, map flows and boundaries, connect an attack path to its impact, prioritize it, and create owned work with a test. Update the decisions when a boundary or important assumption changes.