Threat Modeling for Developers: STRIDE in Practice

A practical guide to threat modeling: data flow diagrams, trust boundaries, STRIDE threats, prioritising risks.

Published December 6, 2026

Most security bugs are cheapest to fix before any code is written. Threat modeling is a structured conversation about what you are building, what can go wrong, what you will do about it, and whether you did a good job. It does not require security specialists or heavy documents; a whiteboard, a data flow diagram and the STRIDE mnemonic go a long way.

The concept

Start by drawing a data flow diagram: external actors (users, partner systems), processes (your services), data stores (databases, queues, buckets) and the data flows between them. Mark trust boundaries, places where data crosses from a less trusted zone to a more trusted one, such as browser to API, API to database, or your system to a third party. Threats cluster at these boundaries.

Then walk each element and flow with STRIDE: Spoofing identity, Tampering with data, Repudiation (denying actions without proof), Information disclosure, Denial of service and Elevation of privilege. For each credible threat, decide on a mitigation, accept the risk explicitly, or redesign. Capture the result as tickets and a short document, and revisit it when the design changes.

STRIDE categories

STRIDEThreatExampleTypical mitigation
SSpoofingForged webhook callsAuthentication, signatures
TTamperingModified price in requestServer-side validation, integrity checks
RRepudiationUser denies placing orderAudit logs, signed records
IInformation disclosureVerbose errors leak SQLError handling, encryption, access control
DDenial of serviceHuge file uploadsRate limits, size limits, quotas
EElevation of privilegeUser calls admin APIAuthorization checks, least privilege

A simple data flow diagram

HTTPSwebhook in/outSQLBrowseruntrustedAPItrust boundary ↑Payments providerexternalDatabaseinternal
Trust boundaries are where to look hardest.

Running a session

  1. What are we building? Draw the DFD (30 min)
  2. What can go wrong? Apply STRIDE per boundary
  3. What will we do? Mitigate, accept or redesign
  4. Did we do a good job? Review after implementation
  5. Repeat when the design changes
The four-question framework.

Practical examples

Threat model notes for a feature

Short, actionable, linked to tickets.

Feature: Payment webhooks
Boundary: Payment provider → /webhooks/payments
S: attacker forges "payment succeeded" → verify HMAC signature + timestamp (SEC-112)
T: replay old events → reject timestamps > 5 min, dedupe event IDs (SEC-113)
D: flood endpoint → rate limit per source, async processing (SEC-114)
I: logs contain card data → log only event ID and status (SEC-115)

Add a threat modeling prompt to design docs

Make it a normal part of design review.

## Security considerations
- Trust boundaries crossed:
- New data stored (classification):
- STRIDE threats identified and mitigations:
- Risks accepted (owner, reason):

Threat modeling as code (example tool)

Some teams describe models in code for versioning.

# e.g. pytm / Threat Dragon models stored in the repo and reviewed in PRs

Common mistakes

  • Waiting for a security team to do it after implementation.
  • Producing a huge document nobody reads or updates.
  • Listing threats without deciding mitigations or owners.
  • Ignoring third-party integrations and internal admin tools.

Key takeaways

  • Threat modeling finds design flaws before code exists.
  • Draw data flows and mark trust boundaries.
  • Use STRIDE to enumerate threats systematically.
  • Turn findings into tickets and revisit when designs change.

FAQ

How long does a session take?

For a single feature, 30-90 minutes with the people who build it is usually enough.

Do I need special tools?

No. A whiteboard or diagram tool works; tools like OWASP Threat Dragon help keep models versioned.

What other methods exist?

PASTA, LINDDUN (privacy), attack trees and kill chains; STRIDE is the most approachable for developers.

More Security articles