Most threat models are written after the architecture is settled, reviewed by people who were not in the design meetings, and filed. They produce a list of mitigations that are all local — validate this input, add a rate limit there — because by the time they run, nothing structural can move. A threat model earns its cost only when it changes where boundaries sit, who holds authority, and what a compromised component can reach. The measurable output of the practice is design deltas, not documents.
The useful question to ask of any threat-modelling practice is not how many threats it identified but how many findings became design changes rather than tickets. In most organisations that ratio is close to zero, and the cause is timing, not rigour. The model runs when a security review is a launch gate — after the schema exists, after the tenancy model is chosen, after the worker has been given one IAM role for convenience. At that point every finding has to be answered with a compensating control, because the structural answer would mean re-doing a quarter of work.
The multipliers are illustrative; the shape is not. Structural properties — whether tenants share a key, whether the worker can reach every bucket — are nearly free to choose before the first schema migration and nearly impossible to change after the second year. A model that first runs at pre-launch can only buy compensating controls.
The decisions that determine most of a system’s security posture are made early and quietly, usually by someone optimising for something else: whether tenants share a database, whether the async path carries identity or just IDs, whether staff tooling goes through the product API or straight to the store, whether one KMS key encrypts everything. None of these reads as a “security decision” in the RFC. All of them fix the cost of every attack for years. A threat model has to be present in the room where those choices are made, which means it has to be cheap enough to run in the first design review and structured enough to produce an answer that changes the diagram.
The practical test for whether a decision needs modelling now is to ask what undoing it would touch. If the answer is code only, it is a two-way door and the model can wait. If the answer is data at rest, derived stores or external contracts, the door is closing with every write. A missing tenant_id column is a backfill across every table, cache, search index, warehouse extract and backup that inherited the shape. One KMS key for all tenants means every object written so far must be re-encrypted before per-tenant keys mean anything — illustratively, 200 TB re-encrypted at an aggregate 500 MB/s is about 4.6 days of saturated throughput, before you account for KMS request quotas, the dual-read period and the backups you cannot rewrite. A webhook format partners have integrated against is a deprecation programme measured in quarters. Those are the decisions a model has to reach before the first production write, and the list is short enough to check in a single design review.
Adam Shostack’s four questions — what are we working on, what can go wrong, what are we going to do about it, did we do a good job — remain the best frame, but the third question is where practice degrades. “What are we going to do about it” silently becomes “what controls will we add”, and controls are bolt-ons. The architectural version is what will we change so this cannot happen, or cannot matter. That reframing is the whole chapter.
Architect's note
Data-flow diagrams draw boundaries around network zones — VPC, subnet, cluster — because those are visible in the infrastructure. The boundary that matters is different: a trust boundary is any point where the principal, or the privilege being exercised, changes. A call from the API service to Postgres in the same subnet crosses a boundary (a user’s authority becomes the service’s all-tenant credential). A message from the API to a worker via a queue crosses one too, and it is the one most commonly left undefended, because the worker treats the payload as trusted internal data.
Green crossings are the ones every diagram shows and every team already controls. The pink ones are where authority is carried implicitly: a message that asserts its tenant, a role that outlives the request that justified it, a staff tool that talks to the database directly, a build system that can run arbitrary code in production.
For each crossing, a model needs four answers, and the missing answer is the finding. Who is the principal on the far side? Not “the service” — whose authority does the request carry? How is that established? Transport identity, a signed token, or an assertion in a payload field. Where is the authorization decision made, and is it made again or inherited? What happens if the sender is hostile? Not buggy — hostile, sending exactly the bytes that hurt most.
Crossing 6 is the canonical failure. The API authorises tenant A, enqueues a job with tenant_id=A, doc_id=42, and the worker processes it with a role that can read every tenant. Any path that lets an attacker influence the payload — a bug in the enqueue code, a second producer added later, a replay tool used during an incident — converts into cross-tenant access, because the worker performs no decision of its own. The worker is a confused deputy: it holds authority the requester does not, and acts on the requester’s say-so. The architectural fix is not to validate the payload harder. It is to make the message carry verifiable authority (a signed, scoped, short-lived token minted at the API) or to give the worker credentials derived from the tenant, so a forged tenant ID buys nothing.
That fix has a second-order effect a design review should catch: it swaps a forgery problem for an expiry-and-replay problem. A job’s lifetime is not its processing time. It is the tail set by retry back-off, dead-letter handling and a human redriving the DLQ after the fix ships two days later. A short token TTL fails exactly those jobs. The on-call engineer then adds a “skip verification for redrive” flag, and that flag becomes the new crossing 6. A TTL long enough to cover redrive puts a week-lived bearer credential at rest in the broker, the DLQ and whatever tooling reads it, all of which usually have broader readers than the API. The design that survives separates the two: short-lived authority for the hot path, and a redrive path that goes back through the API to re-mint against current grants, so a user revoked between enqueue and redrive stops the work. Bind the token to the job’s idempotency key too, so a replayed message still does the work once.
Timings are illustrative. The token’s lifetime has to be chosen against the tail of the job’s lifetime, not its median, and the tail is set by retry policy and incident response, not by the worker. Option C is the only one where revoking a user between enqueue and redrive actually stops the work.
Crossing 10 is the one that surprises teams. Anything that parses attacker-supplied bytes is on the attack surface, whether or not it is on the request path. Log4Shell (December 2021) is the reference case — a logged user-agent header became remote code execution in whichever system parsed it, including downstream systems that merely re-logged it. Observability pipelines, search indexers, PDF renderers and email parsers are all processing untrusted input, typically with broad read access and little scrutiny.
Pitfall · counting boxes instead of crossings
STRIDE is a good vocabulary and a poor procedure. Applied per element, it produces the product of components and categories: forty elements times six categories is 240 prompts, most answered with boilerplate (“tampering: use TLS”). The output is long, uniformly weighted and cannot be prioritised, which is why nobody reads it. The failure is structural: STRIDE-per-element enumerates kinds of harm without asking who would bother.
Invert the procedure. Begin with attacker goals — outcomes someone would spend money or time to reach — and work backwards to the cheapest path through your design. For a B2B SaaS product, the list is short: read another tenant’s data; act as another user; move or extract value (credits, payouts, refunds); get persistent code execution; make the service cost you money; destroy or ransom data. Each is a root of an attack tree, and the tree’s value is its cheapest leaf, because an attacker takes the minimum, not the average.
GOAL · cross-tenant read of B’s documents
attacker = any paying tenant ($0 to become one)
These branches are OR alternatives, so the goal’s cost is the minimum over branches, not the sum. Hardening the expensive branch (encryption strength) changes nothing; the goal’s cost is set by the cheapest leaf. Each cheap leaf here exists because of a structural decision, so each fix is a design change rather than a patch.
Costing leaves forces a conversation the element-by-element approach never has. It is uncomfortable to find that the cheapest path to every tenant’s data does not involve the product at all. That is the pattern across several well-documented incidents. In the July 2020 Twitter compromise, attackers used phone spear-phishing against employees to reach internal account-administration tooling and took over high-profile accounts; the product’s authentication was not the path. In the 2019 Capital One breach, a server-side request forgery against a misconfigured web application firewall retrieved credentials from the EC2 instance metadata service, and the role attached to that instance could read far more S3 data than its function required. In the September 2022 Uber intrusion, a contractor’s credentials plus repeated MFA push prompts gained a foothold, and hardcoded privileged-access credentials in a script on an internal share did the rest. In each case the decisive link was a staff or infrastructure path with more authority than its job needed — precisely the crossings a per-element model is least likely to draw.
The “cheapest leaf” rule needs one correction before it is used for prioritisation. It holds at OR nodes, where any branch reaches the goal. Real paths are mostly AND chains: SSRF, then metadata access, then a role broad enough to matter, then a bucket layout that lets one credential list everything. At an AND node, costs add and success probabilities multiply. So the defender’s best move is the hop that is cheapest to break by construction, and ideally one where several chains meet. The instance role in the Capital One chain is such a point: an SSRF, an RCE in an image-processing library and a compromised dependency all end up holding the same credential, so scoping it cuts three trees at once. Rank candidate fixes by how many cheapest paths pass through them, not by the severity label on the finding that surfaced them.
40 × 6
STRIDE prompts, 40 elements
~6
attacker goals, typical SaaS
min()
a tree costs its cheapest leaf
0
breaches above via crypto
Architect's note
The largest category of real-world harm to modern products involves no vulnerability. Credential stuffing uses the login endpoint as specified. SMS pumping uses the OTP endpoint as specified, with the attacker earning a share of the termination fees you pay. Referral and promotion fraud uses the growth feature as specified. Scraping, account enumeration through password-reset timing, and cost amplification against an expensive endpoint — an LLM completion, an export job, a search with no result limit — all use the system as designed. No scanner or pentest reliably finds these, because the code is correct. The design is not.
Abuse cases are modelled with economics, not with vulnerability taxonomies. An attempt pays when p · V > c: success rate times value per success exceeds cost per attempt. Every control acts on exactly one of those three terms, and they are not equally cheap to move.
All points illustrative. Tripling the attacker’s per-attempt cost moves the point sideways by half a decade; cutting the success rate by 500× moves it down almost three decades. B is still above the V = $500 line: high-value accounts need controls on V as well. Controls that attack p (signals per credential and per account) or V (delays on withdrawing value) dominate controls that attack c (per-IP rate limits, CAPTCHAs).
Illustratively: a credential-stuffing operation using residential proxies might pay a fraction of a cent per attempt and succeed on a fraction of a percent of reused credentials. Per-IP rate limiting and CAPTCHAs attack c; residential proxy pools and solving services exist precisely to keep that cost low and roughly linear, so you get small multiples. Checking submitted passwords against breach corpora, requiring step-up on new-device logins, and binding sessions to device signals attack p, and move it by orders of magnitude, because they target the reason the attack works — reused credentials — instead of the attacker’s infrastructure. Holding newly acquired value (a delay before first payout, before gift-card redemption, before changing the payout account) attacks V, and turns a fast cash-out into a slow one your detection can catch.
The second-order effect is displacement. A control on one endpoint does not remove the attacker’s goal; it re-prices one leaf of the tree, and the attack moves to the next-cheapest leaf. Harden the web login and the traffic shifts to the mobile API’s login, the legacy v1 token endpoint, the password-reset flow that confirms whether an account exists, or the SSO callback that skips the breached-password check. The unit of modelling is therefore the goal — “validate a credential pair” — and the inventory is every endpoint that answers that question, including the ones kept alive for one old client. A defence that is strong on four of five such endpoints has the strength of the fifth, and the attacker finds the fifth faster than your dashboards do, because their success rate is their dashboard.
The same arithmetic applies to cost amplification, where the attacker’s goal is your bill. If an unauthenticated endpoint costs you a cent per call and the attacker pays a hundredth of a cent, the asymmetry is 100:1 in their favour. Illustratively, a botnet sustaining 500 requests per second against that endpoint costs you $5 a second — about $430,000 a day — while costing the attacker a few thousand dollars; the incident is decided by how fast someone notices the bill, not by any control. The design question is where the first expensive operation sits relative to the first point at which you know who the caller is and can bill or throttle them. Moving an expensive step behind authentication, or behind a per-account budget enforced before the call, is an architectural change; a WAF rule is not.
Pitfall · abuse cases owned by nobody
A finding recorded as “ensure the handler checks document ownership” describes a behaviour that must be repeated, correctly, by every future engineer on every future handler. A finding recorded as an invariant plus an enforcement point — “no query against the documents table executes without a tenant predicate; enforced by row-level security keyed on a per-transaction setting derived from the authenticated request” — describes a property the system holds by construction. The first scales with headcount and decays with time. The second is tested once and then holds.
The ladder orders controls by how they fail. Eliminate fails only if the business insists on the capability. Make it unrepresentable — separate stores, per-tenant keys, a type that cannot be constructed without a tenant scope — fails when someone builds a bypass, which is visible and reviewable. One choke point fails through bypass paths too, so the modelling job is to enumerate them: raw SQL escape hatches, migration scripts, the analytics replica, the support tool. With Postgres row-level security the bypasses are concrete and easy to miss. Superusers and roles with BYPASSRLS skip policies entirely. The table owner skips them unless the table has FORCE ROW LEVEL SECURITY — and applications very often connect as the owner, because that is the role that ran the migrations. And a tenant set with a plain session-level SET behind a transaction-mode pooler such as PgBouncer stays on the server connection and is inherited by whichever client borrows it next. The invariant needs an application role that owns nothing, with the tenant set by SET LOCAL (or set_config(…, true)) inside each transaction so it cannot outlive the request. Check at every call site fails silently, one omission at a time, and the arithmetic is unkind.
Per-site correctness rates are illustrative and assume independence, which is generous — real omissions cluster in the least-reviewed code. A single enforcement point replaces pᴺ with one p that you can test exhaustively.
If each of 400 handlers has a 99.5% chance of carrying a correct object-level check — a generous rate given that a mistyped parameter or a missing branch counts as failure — the probability that all of them are correct is about 13%. The probability that at least one is exploitable is therefore about 87%, and it rises with every feature. This is why broken object-level authorization sits at the top of the OWASP API Security Top 10: not because engineers do not understand it, but because a per-call-site control is a bet against the exponent. Detailed treatment of where to evaluate policy and how to cache decisions belongs to Authorization at Scale; the modelling point is that a finding which recommends “add a check” should be rewritten until it names a choke point.
The output format that makes this stick is a design delta, one per material finding: the threat (goal, attacker position, crossing), the invariant that defeats it, the enforcement point, the test that proves it — ideally a negative test in CI that attempts the attack — and the owner. Deltas go into the design document itself, not a separate security artefact, so the diagram is updated and the invariant is visible to the next person who changes that code. A finding that cannot be expressed as a delta either needs a different rung of the ladder or becomes a risk acceptance, and section 1.7 deals with those.
Architect's note
The boundary-and-goal approach finds paths in from outside. It does not answer the question that determines incident severity: once one component is owned, what else falls? The compromise walk answers it mechanically. For each component, assume full control by an attacker — code execution, its credentials, its network position — and record what they now hold. Do this for components that are not on the product diagram, because that is where the answers are worst.
The row sums are the finding. A design where a worker pod and a support account each score “all tenants: full” has no internal boundaries; it has one perimeter and a lot of trusted insiders. The target shape is a matrix where only break-glass paths reach the right-hand columns, and those paths are loud.
Three rows dominate most real matrices. The CI runner can typically deploy to production, reads every secret the build needs, and runs code from pull requests and third-party dependencies; it is the most privileged workload in many companies and the least modelled. Supply-chain mechanics — provenance, signing, isolating builds — are the subject of Software Supply-Chain Security; the modelling job here is to notice that the row exists and scores full across the board. The support tool exists to read customer data across tenants, and is used by the largest and least security-trained group of people with production data access. The engineer’s laptop plus SSO session is effectively a CI runner with a browser attached.
The walk also exposes shared credentials as hidden edges. Two services with the same IAM role, the same database user or the same KMS key are one component for this exercise, however they are drawn: compromise of either yields both. Counting distinct credentials against distinct functions is a quick diagnostic. If a system has thirty services and six credentials, the model should assume six components, not thirty — and the matrix will show it.
The arithmetic shows why shared credentials matter more than any one service’s hygiene. Suppose, illustratively, each service has a 1% chance a year of some code-execution compromise (a dependency, an SSRF, a deserialisation bug). If thirty services share one all-tenant role, the chance that the role is exposed within the year is 1 − 0.99³⁰ ≈ 26%, and each exposure reaches everything. Split the role per service and the per-service rate is unchanged, but reach drops to one service’s slice. Expected blast radius scales roughly with (services sharing a credential) × (data that credential reaches) × (dwell time before detection). Credential splitting cuts the first two terms. Only detection cuts the third, which is why the chain below ends with a detect control, not a preventive one.
probabilistic controls, 0.5 per hop (illustrative)
0.5⁵ ≈ 3% per attempt — ≈ 96% over 100 attempts
one hop made unrepresentable
p₄ = 0 → chain = 0 for every attempt, until someone adds a bypass
Hops follow the shape of the 2019 Capital One breach described in 1.3; the controls are the design responses, not a description of what that environment had. Retries are what make a per-attempt product misleading: 1 − (1 − 0.031)¹⁰⁰ ≈ 0.96, so stacking leaky controls buys time, not safety.
The architectural responses come from the ladder, applied to reach rather than to entry. Split roles so a worker holds only the authority of the job it is processing (credentials minted per task and per tenant); route staff access through the product’s own authorization with tenant scoping, justification and time limits rather than a direct database path; separate the ability to build from the ability to deploy, with a deploy step that verifies what it is deploying; and make the audit trail write-only from every row in the matrix, including the observability pipeline, so compromise of any one component cannot erase its own evidence. How to make those credentials short-lived and workload-bound is covered in Identity & Zero Trust; designing the detection and investigation side is the subject of Detection & Response by Design.
Pitfall · the break-glass path that is always open
Threat modelling on a calendar — every service, annually — produces stale models of systems that have since changed, and burns reviewer time on services that have not. Trigger it on the kind of change, since only a few kinds move the trust map: new externally reachable surface, a new principal type, a new data class, a new crossing between zones, or a change to the authorization model. Most engineering work is none of these, and should pass with a checklist in the pull-request template.
Two triggers deserve emphasis because teams underrate them. New principal types — partner integrations, delegated access, impersonation for support, and increasingly AI agents that call internal tools — change who holds authority without changing the network at all. An agent that reads untrusted content and can call a tool with the user’s credentials is a textbook confused deputy; the mechanics of prompt injection and tool isolation are covered in the AI-Native Architecture track, and the threat-modelling step is simply to draw the agent as its own principal with its own crossing. New data classes change the attacker’s value per success, and hence which branches of the tree are worth paying for; a system that starts storing payout bank details has acquired new attackers, whatever its code looks like.
The session itself should be short and specific. Forty-five minutes, run on the actual design document, with the engineer who will be on call for the system, someone who has operated the adjacent systems, and one person whose job is to argue as the attacker. The artefact is the updated diagram with numbered crossings, the goal list with the cheapest path per goal, and the design deltas. Keep the model in the repository next to the service, as text that diffs — a crossing table in markdown or a threat-model-as-code format — so a pull request that adds a queue consumer or a new store is visibly a change to the model and can be flagged by a CODEOWNERS rule.
The failure mode of a model in the repository is drift: the model says the worker reads one bucket, the IAM policy was widened during an incident eight months ago, and nobody edited the markdown. Treat the model as a claim and the infrastructure as evidence. Most crossings can be derived mechanically — IAM policies and role trust relationships, Kubernetes network policies and service-mesh authorization rules, queue and topic subscriptions, database grants, CI deploy permissions. Generate that edge list on a schedule and diff it against the declared crossing table. An edge in the infrastructure but not in the model is either an undocumented crossing or excess privilege, and both are findings; an edge in the model but not in the infrastructure is stale text. That turns the model from a document someone must remember to update into a check that fails when reality moves, which is the only kind that stays true for longer than a quarter.
Everything not fixed becomes a risk acceptance, and acceptances are where security programmes quietly accumulate debt. Each one needs a named owner with authority over the budget that would fix it, a stated condition under which it is revisited, and an expiry date after which it lapses and must be re-accepted. Expiry matters because the justification decays: “only three internal users have that access” is true in March and false by October. Track the median age and count of live acceptances per system; a growing pile of old acceptances is a better leading indicator of an eventual incident than any count of open findings.
What may be accepted is itself a design decision, and CVSS-style severity is the wrong axis for it. Severity scores the exploit. It says nothing about whether waiting makes the fix more expensive, and that is the property that separates a safe deferral from a trap. Triage on two axes. First, what the fix touches: code only, data at rest and its derived stores, or a contract someone else has built against. Second, what the finding reaches if exploited. A cross-tenant bug that a code change fixes can wait for the next sprint with a negative test guarding it. A missing tenant key in the event schema cannot, because every event written in the meantime is one more to backfill or one more that can never be attributed.
Risk acceptance is only on the table in the top row, where waiting does not make the fix more expensive. Below it, every month of production writes raises the cost of the fix, so an accepted risk turns into a permanent one without anyone deciding that.
Questions to ask in the design review
45 min
per design-review model
10–20
crossings, typical product
≤ 12 mo
max acceptance lifetime (suggested)
deltas ÷ findings
the metric that matters
Where next