Threat Modeling for Developers, Not Security Teams
- ShiftQuality Contributor
- Sep 6, 2025
- 5 min read
Most developers encounter threat modeling in one of two ways: either they never encounter it at all, or they sit through a multi-day workshop run by the security team that produces a massive document nobody reads again. Neither approach actually makes software more secure.
Threat modeling does not need to be a formal, heavyweight process. At its core, it is structured thinking about what can go wrong. You already do this informally — every time you think "what if the database is down" or "what if someone sends a malicious payload," you are threat modeling. The goal is to make that thinking deliberate rather than accidental.
What Threat Modeling Actually Is
Threat modeling is answering four questions about your system:
What are we building? A description of the system, its components, and how data flows between them.
What can go wrong? A structured enumeration of potential threats.
What are we going to do about it? Decisions about how to address each threat — mitigate, accept, transfer, or avoid.
Did we do a good job? Review and validation that the analysis is reasonable.
That is it. Everything else — the frameworks, the diagrams, the tools — exists to help you answer those four questions more thoroughly. But the questions themselves are simple.
STRIDE: A Framework That Fits in Your Head
STRIDE is a mnemonic developed at Microsoft that categorizes threats into six types. It is not the only framework, but it is the most widely used and the easiest to remember.
Spoofing — Can someone pretend to be someone or something they are not? This covers authentication failures. Can an attacker impersonate a user? Can a service impersonate another service? Can a request be forged to look like it came from a trusted source?
Tampering — Can someone modify data they should not be able to modify? This covers data integrity. Can someone alter a database record? Modify a message in transit? Change a configuration file? Tamper with log entries to cover their tracks?
Repudiation — Can someone deny they did something, and can you prove they did? This covers logging and audit trails. If a user deletes important data, can you prove who did it? If a transaction is disputed, do you have evidence?
Information Disclosure — Can someone access information they should not see? This covers confidentiality. Can someone read another user's data? Extract secrets from logs? Access internal APIs from outside the network? See error details that reveal system internals?
Denial of Service — Can someone prevent legitimate users from accessing the system? This covers availability. Can someone overwhelm your API with requests? Exhaust your database connections? Fill your disk with log data?
Elevation of Privilege — Can someone gain capabilities they should not have? This covers authorization. Can a regular user access admin functions? Can an attacker escape a container? Can a low-privilege process access high-privilege resources?
The 30-Minute Threat Model
Here is a practical approach you can do in a single meeting.
Step 1: Draw the System (5 minutes)
Sketch the components of what you are building and how data flows between them. This does not need to be a formal diagram. Whiteboard-level is fine. Include users, services, databases, external APIs, and any trust boundaries — lines where the level of trust changes (like the boundary between the internet and your internal network).
Step 2: Walk Through STRIDE (15 minutes)
For each component and each data flow, walk through the STRIDE categories. You do not need to be exhaustive. Focus on the areas where you are least confident in your protections.
Ask questions like: Who authenticates to this service? What happens if authentication is bypassed? Can data be modified in transit between these two services? Are we logging enough to detect and investigate problems? What happens if this database is exposed? What is our rate limiting strategy?
Write down each threat you identify. A sentence is enough: "An attacker could forge a webhook callback to trigger unauthorized actions."
Step 3: Prioritize and Decide (10 minutes)
For each threat, make a decision:
Mitigate — Implement a control. Add authentication, encrypt data, add rate limiting.
Accept — The risk is low enough or the cost of mitigation is too high. Document this decision explicitly.
Transfer — Someone else handles this risk. Your cloud provider handles physical security, your payment processor handles PCI compliance.
Avoid — Remove the feature or change the design to eliminate the threat entirely.
You do not need to mitigate everything. You need to make deliberate decisions and document them.
Threats Developers Commonly Miss
Server-Side Request Forgery (SSRF)
If your application makes HTTP requests based on user input — fetching a URL, loading an image, calling a webhook — an attacker may be able to make your server request internal resources. This is how the 2019 Capital One breach happened. Any feature that takes a URL as input needs SSRF protection.
Dependency Attacks
Your application is not just your code. It is your code plus hundreds of dependencies. Each dependency is a potential attack vector. Typosquatting (publishing malicious packages with names similar to popular ones), compromised maintainer accounts, and supply chain injection are all real threats.
Secrets in Unexpected Places
Developers know not to commit passwords to git. But secrets leak through other channels: error messages that include connection strings, log entries that capture request headers containing API keys, environment variables that are exposed through debug endpoints, and CI/CD configurations that echo secrets during build steps.
Insecure Direct Object References
When your API endpoint is /api/orders/12345, can user A access user B's order by changing the ID? This is one of the most common vulnerabilities in web applications, and it is entirely preventable with proper authorization checks.
Race Conditions
When two requests arrive simultaneously, does your code handle them correctly? Race conditions in financial transactions, inventory management, and resource allocation can be exploited to create inconsistent state.
Integrating Threat Modeling Into Your Workflow
The most effective threat modeling happens early — during design, not after implementation.
Design Reviews
Add a threat modeling section to your design review process. When someone proposes a new feature or service, spend 15 minutes walking through STRIDE. This is dramatically cheaper than finding security issues in production.
Pull Requests
For PRs that introduce new authentication flows, data storage, external integrations, or API endpoints, include a brief threat analysis in the PR description. "This adds webhook support. Authentication is via HMAC signature verification. I considered SSRF and mitigate by restricting callback URLs to HTTPS and validating against an allowlist."
Sprint Planning
If a sprint includes work that changes security boundaries — new external integrations, authentication changes, data model modifications — flag it for threat modeling. Not every ticket needs it. But the ones that touch security boundaries do.
Tools That Help
Microsoft Threat Modeling Tool — Free, structured, generates STRIDE-based threats from data flow diagrams. Heavier than the 30-minute approach but useful for critical systems.
OWASP Threat Dragon — Open-source, browser-based threat modeling tool. Lighter weight than Microsoft's tool.
draw.io / Excalidraw — For the informal approach, any diagramming tool works. The diagram is a thinking aid, not a deliverable.
Checklist-based approaches — OWASP's testing guide and ASVS (Application Security Verification Standard) provide comprehensive checklists that can supplement STRIDE-based analysis.
The Mindset Shift
Threat modeling is not about achieving perfect security. It is about making security decisions deliberately rather than by accident. The goal is not to eliminate all risk — that is impossible. The goal is to understand what risks exist, make conscious choices about which ones to address, and document those choices so that future developers understand why things are built the way they are.
The best security investment most development teams can make is not buying a new tool or hiring a penetration tester. It is spending 30 minutes thinking about what could go wrong before writing the code. That habit, applied consistently, prevents more vulnerabilities than any scanner.



Comments