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
| STRIDE | Threat | Example | Typical mitigation |
|---|---|---|---|
| S | Spoofing | Forged webhook calls | Authentication, signatures |
| T | Tampering | Modified price in request | Server-side validation, integrity checks |
| R | Repudiation | User denies placing order | Audit logs, signed records |
| I | Information disclosure | Verbose errors leak SQL | Error handling, encryption, access control |
| D | Denial of service | Huge file uploads | Rate limits, size limits, quotas |
| E | Elevation of privilege | User calls admin API | Authorization checks, least privilege |
A simple data flow diagram
Running a session
- What are we building? Draw the DFD (30 min)
- What can go wrong? Apply STRIDE per boundary
- What will we do? Mitigate, accept or redesign
- Did we do a good job? Review after implementation
- Repeat when the design changes
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 PRsCommon 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.