Defensive Security

Threat Modeling with STRIDE: Finding Design Flaws Before You Build Them

Threat modelling is the cheapest security activity available, because it finds flaws before they have been built. A missing authorization check costs an hour to design correctly, a day to fix in development, a week to fix in production and considerably more once it has been exploited. STRIDE is simply a structured way to notice it at the first stage.

Defensive Security

The six categories

STRIDE names six things that can go wrong. Each maps to a property you were relying on.

  • Spoofing — pretending to be someone else. Breaks authentication.
  • Tampering — modifying data in transit or at rest. Breaks integrity.
  • Repudiation — denying an action with no evidence to contradict it. Breaks non-repudiation.
  • Information disclosure — exposing data to the wrong party. Breaks confidentiality.
  • Denial of service — making the system unavailable. Breaks availability.
  • Elevation of privilege — doing something you are not entitled to do. Breaks authorization.

The value is not the taxonomy; it is that the list is short enough to hold in your head and complete enough that walking it catches things an unstructured discussion misses.

Running a session that produces decisions

1. Draw the diagram. A data flow diagram, not an infrastructure diagram: external entities, processes, data stores, the flows between them, and — most importantly — the trust boundaries those flows cross. A whiteboard photograph is a perfectly acceptable artefact.

2. Mark every trust boundary. Browser to server, server to database, your service to a third-party API, tenant A to tenant B, unauthenticated to authenticated, user to admin. Nearly every finding will sit on one of these lines, which is why the diagram is worth the twenty minutes it takes.

3. Walk the elements, not your intuition. For each process, data store and flow, ask the six questions. The discipline of asking all six even when five feel irrelevant is what makes this different from a chat about security. Repudiation in particular is almost always skipped, and it is the one that determines whether you can investigate an incident later.

4. Record the threat concretely. "Spoofing" is not a finding. "An attacker who obtains a long-lived API token can act as any tenant because the token is not bound to a tenant" is a finding, because it suggests its own fix.

5. Decide on each one. Mitigate, with an owner and a ticket number. Accept, with a named approver and a date to revisit. Transfer, usually contractually. Or eliminate by removing the feature. A threat model with no decisions attached is a document, not a control.

What good findings look like

A worked fragment for a file-sharing feature:

  • Spoofing — Share links contain a predictable identifier, so a third party can guess a valid link. Mitigate: 128-bit random token plus optional expiry.
  • Tampering — The upload service trusts a tenant_id field supplied by the client. Mitigate: derive tenant from the session, never from the request body.
  • Repudiation — Deletions are not logged with actor and timestamp, so a disputed deletion cannot be investigated. Mitigate: append-only audit log, retained 12 months.
  • Information disclosure — Thumbnails are generated into a public bucket. Mitigate: serve through the authorised path; no public bucket.
  • Denial of service — No size or rate limit on uploads. Mitigate: per-tenant quota and request limits, per API rate limiting.
  • Elevation of privilege — The preview renderer parses untrusted documents with default settings. Mitigate: disable external entities, render in an isolated process — see XXE injection.

Six categories, six specific tickets, roughly an hour. Every one of those would otherwise have been a finding in a penetration test months later, at considerably greater cost.

Keeping it alive

Most threat modelling programmes fail the same way: a heavyweight first attempt, a large document, and nobody repeats it. What survives is lightweight and attached to work people already do.

  • Scope to one feature or service, never "the platform".
  • Trigger on change, not on a calendar — a new trust boundary, a new integration, a change in data sensitivity.
  • Keep the diagram in the repository alongside the code, so it is updated by the same pull request that changes the design.
  • Timebox to ninety minutes. Anything longer means the scope was too large.
  • Track the mitigations in the normal backlog. A separate security backlog is a backlog that does not get worked.

Where it fits alongside testing

Threat modelling and penetration testing answer different questions. Modelling asks "what could go wrong with this design?" — it finds missing controls, including ones a tester would never see because the feature behaves correctly. Testing asks "what did go wrong in this implementation?" — it finds the gap between the design and the code. You need both, and the comparison in security audit vs penetration test vs vulnerability scan sets out where each belongs.

For deeper reference material, OWASP's threat modelling process covers alternative methodologies and worked examples. If you would like a facilitated session on a design that is about to be built, that sits inside our risk assessment work.

Frequently asked questions

What is STRIDE threat modeling?
STRIDE is a mnemonic for six threat categories — Spoofing, Tampering, Repudiation, Information disclosure, Denial of service and Elevation of privilege. You walk a design diagram and ask which of the six apply at each element and data flow.
When should threat modeling happen?
At design time, before implementation, and again whenever the architecture changes materially — a new trust boundary, a new external integration, a new data classification. Modelling after release still helps but has lost most of its cost advantage.
How long does a threat modeling session take?
For one feature or service, 60 to 90 minutes with three or four people is normal once the diagram exists. Sessions that run longer are usually trying to model too much scope at once.
Who should attend a threat modeling session?
Someone who knows the design in detail, someone who will build it, someone with a security background, and ideally someone who operates it. Four people is the practical maximum before discussion stops converging.
What is the output of a threat model?
A short list of identified threats, each with a decision: mitigate (with an owner and a ticket), accept (with a named approver), transfer, or eliminate. A diagram with no decisions attached is not a threat model.

Related reading

0 comments

Leave a comment

Comments are moderated before appearing.