SyntaxPilot
Courses/Cybersecurity Fundamentals/Lesson 7

Cybersecurity Fundamentals · Lesson 7 of 90 · 15 min

Threat modelling

threat modeldata flow diagram (DFD)trust boundaryentry pointsSTRIDE (spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege)DREADattack treesPASTALINDDUN (privacy threats)the four questionsmitigationsthreat model as a living documentOWASP Threat Dragon

These are the notes for Cybersecurity Fundamentals (defensive), episode 7. Until now we reacted to attacks after they happened. Today we flip it: before a single line of code is written, we find where a system can be attacked and fix it on paper, where fixing is cheap. You'll invent each idea from a real-life problem and build small Python tools: threat modelling and the four questions, data flow diagrams (DFDs) with external entities, processes, data stores and data flows, trust boundaries and entry points, STRIDE and STRIDE per element, why DREAD was dropped and what replaced it, attack trees, PASTA, LINDDUN, the four mitigation responses, the threat model as a living document, and OWASP Threat Dragon. Every term is explained the first time it appears, and the Glossary at the end defines them all again.

The app (ChaiGo), the stall and everyone in it are made up; nothing is contacted. Every code sample runs as-is; outputs are real (Python 3).

The problems you'll solve

Problem Idea it teaches
Free chai with a faked "paid" message, found after launch Threat modelling, the four questions
"It's an app, a server and a database" hides the doors Data flow diagrams (DFDs)
Checking only what comes from the internet Trust boundaries, entry points
A brainstorm finds 3 vague threats STRIDE, STRIDE per element
Two experts score with DREAD and disagree Likelihood x impact with written scales
How would an attacker actually do it? Attack trees
Security isn't the only harm PASTA (business risk), LINDDUN (privacy)
What do we do about each threat? Mitigate, eliminate, transfer, accept
The model was for an app that no longer exists Living document, OWASP Threat Dragon

Problem 1: security at the end is too late

ChaiGo lets you order chai on your phone, pay by UPI (India's instant bank-to-bank payment system) and collect it at the stall. A week after launch, the stall's screen shows PAID and the staff serve chai, but no money ever arrived: someone found a way to send the app a fake "payment successful" message. It's the software version of the fake UPI payment screenshots some shopkeepers get shown.

The team had planned to "test security at the end". Now the fix means redesigning the payment flow, shipping an app update and sorting out refunds: weeks of work for a problem that would have taken ten minutes to spot on a whiteboard.

A threat (episode 1) is anything that could cause harm. A threat model is a structured picture of what can go wrong in a system and what you'll do about it. Making one is threat modelling. Every threat model answers the four questions (from the Threat Modeling Manifesto, credited to Adam Shostack's four-question frame):

# Question What you produce
1 What are we working on? A diagram of the system (a DFD)
2 What can go wrong? A list of threats (STRIDE, attack trees, LINDDUN)
3 What are we going to do about it? A response for each threat (mitigations)
4 Did we do a good enough job? A review: every high risk handled, mitigations tested

When: while designing, before code. A security guard reviewing a building plan can add a lock to a door in one line; after the building is finished, it means breaking walls.

Problem 2: drawing the system (data flow diagrams)

"It's an app, a server and a database" hides the doors. A guard uses the society's plan, not words. The drawing for software is a data flow diagram (DFD): a picture of how data moves through a system.

Housing society DFD element Drawn as ChaiGo example
Visitors, delivery people External entity: a person or system outside your control A box Customer app, stall owner, UPI gateway
The security desk Process: code that receives data and acts on it A circle Order API (the server program taking orders)
The visitor register Data store: where data rests (database, file, cache) Two parallel lines Orders database
People and parcels moving Data flow: data moving between elements An arrow "order + phone", "payment result"
The society gate Trust boundary: a line where the level of trust changes A dashed line internet / our server / partner

An API (application programming interface) is a way for programs to talk to each other; here, the Order API is the server program the app sends orders to.

ChaiGo's DFD:

   [Customer app] --order + phone--> (Order API) --save order--> = Orders DB =
                                      |      ^
                       payment request|      |payment result
                                      v      |
                                   [UPI gateway]
   [Stall owner] --mark as served--> (Order API)

   zones:  internet  |  our server  |  partner (payment company)

An entry point is any place where data crosses into your zone: a door an attacker can knock on. Anything that crosses a trust boundary must be checked, like a visitor at the gate.

Demo 1: check only what comes from the internet

zone = {"Customer app": "internet", "Stall owner": "internet",
        "Order API": "server", "Orders DB": "server",
        "UPI gateway": "partner"}
flows = [("Customer app", "Order API", "order + phone"),
         ("Order API", "Orders DB", "save order"),
         ("Order API", "UPI gateway", "payment request"),
         ("UPI gateway", "Order API", "payment result"),
         ("Stall owner", "Order API", "mark as served")]

for src, dst, data in flows:     # check what comes from outside
    if zone[src] == "internet":
        print(f"check: {src} -> {dst}: {data}")

Output:

check: Customer app -> Order API: order + phone
check: Stall owner -> Order API: mark as served

The payment result, the exact message that was faked, is never checked, because it comes from a partner, not "the internet".

Demo 1b: every boundary crossing is an entry point

zone = {"Customer app": "internet", "Stall owner": "internet",
        "Order API": "server", "Orders DB": "server",
        "UPI gateway": "partner"}
flows = [("Customer app", "Order API", "order + phone"),
         ("Order API", "Orders DB", "save order"),
         ("Order API", "UPI gateway", "payment request"),
         ("UPI gateway", "Order API", "payment result"),
         ("Stall owner", "Order API", "mark as served")]

for src, dst, data in flows:     # crosses a trust boundary?
    if zone[src] != zone[dst]:
        print(f"{zone[src]:8} -> {zone[dst]:8} {data}")

Output:

internet -> server   order + phone
server   -> partner  payment request
partner  -> server   payment result
internet -> server   mark as served

Four crossings, including partner -> server payment result: the door the free chai came through. A partner's message can be faked, or the partner itself can be hacked, so it gets checked too. Only save order stays inside one zone.

Problem 3: STRIDE

The team brainstorms "what can go wrong?": hackers, viruses, weak passwords. Three vague ideas from memory. Nobody thinks of this: a customer orders ten chais, collects them, then says "I never ordered that, refund me", and ChaiGo has no record to prove who did what. A whole kind of threat, missed. Pilots don't take off from memory; they use a checklist. Threat modelling's checklist is STRIDE, created at Microsoft by Praerit Garg and Loren Kohnfelder (their document is dated 1 April 1999). Each letter is a kind of threat, and each breaks one property from episode 2:

Letter Threat Plain words ChaiGo example Property it breaks
S Spoofing Pretending to be someone or something else A fake "UPI gateway" sending results Authenticity
T Tampering Changing data you shouldn't Editing the price in an order Integrity
R Repudiation Denying you did something, with no way to prove otherwise "I never ordered that" refund trick Non-repudiation
I Information disclosure Data reaching people who shouldn't see it Customers' phone numbers leaking Confidentiality
D Denial of service Making the system unusable Flooding it with fake orders at rush hour Availability
E Elevation of privilege Doing more than you're allowed A customer marking orders as served Authorization

STRIDE per element: not every letter applies to every DFD element.

Element Letters Why
External entity S, R It can be impersonated, and can deny actions
Process S, T, R, I, D, E Code can suffer all six
Data store T, I, D (+ R if it holds logs) Data can be changed, leaked or made unavailable; logs prove who did what
Data flow T, I, D Data in transit can be changed, read or blocked

Demo 2: STRIDE per element

STRIDE = {"S": "Spoofing", "T": "Tampering", "R": "Repudiation",
          "I": "Information disclosure", "D": "Denial of service",
          "E": "Elevation of privilege"}
applies = {"entity": "SR", "process": "STRIDE",
           "store": "TRID", "flow": "TID"}
elements = [("Customer app", "entity"), ("Order API", "process"),
            ("Orders DB", "store"), ("payment result", "flow")]

total = 0
for name, kind in elements:
    letters = applies[kind]
    total += len(letters)
    print(f"{name:15} {kind:8} {letters}")
print(total, "questions to ask, e.g.:")
print(" T on payment result:", STRIDE["T"], "- can it be faked?")

Output:

Customer app    entity   SR
Order API       process  STRIDE
Orders DB       store    TRID
payment result  flow     TID
15 questions to ask, e.g.:
 T on payment result: Tampering - can it be faked?

Fifteen specific questions for four elements, instead of three vague guesses; and "tampering on the payment result" is exactly the question that would have saved ChaiGo.

Problem 4: what to fix first (DREAD vs likelihood x impact)

Fifteen threats, time to fix three this week. Asha and Ravi use DREAD, an older scoring system from Microsoft: each threat gets five scores from 1 to 10.

Letter Question
Damage How bad would it be?
Reproducibility Does it work every time?
Exploitability How easy is it to do?
Affected users How many people?
Discoverability How easy is it to find?

Demo 3: two experts, opposite answers

# scores: Damage, Reproducibility, Exploitability,
#         Affected users, Discoverability (each 1-10)
asha = {"fake pay": [8, 10, 7, 3, 9],
        "DB leak": [9, 4, 5, 10, 3]}
ravi = {"fake pay": [5, 6, 4, 2, 5],
        "DB leak": [10, 5, 6, 10, 6]}

for who, scores in [("Asha", asha), ("Ravi", ravi)]:
    avg = {t: sum(s) / 5 for t, s in scores.items()}
    top = max(avg, key=avg.get)
    print(who, avg, "-> first:", top)

Output:

Asha {'fake pay': 7.4, 'DB leak': 6.2} -> first: fake pay
Ravi {'fake pay': 4.4, 'DB leak': 7.4} -> first: DB leak

Same threats, opposite answers: what does "7 for exploitability" even mean? Microsoft itself stopped using DREAD because the scores were inconsistent and subjective.

Demo 3b: likelihood x impact with written scales

The fix comes from episode 1: risk = likelihood x impact, with short written scales everyone agrees on (for example, likely = will probably happen this year; severe = we lose money or customers' data).

# written scales everyone agrees on
LIKELY = {"rare": 1, "possible": 2, "likely": 3}
IMPACT = {"minor": 1, "serious": 2, "severe": 3}

threats = [("Orders DB leak", "possible", "severe"),
           ("fake payment result", "likely", "severe"),
           ("owner's phone stolen", "rare", "serious"),
           ("app slow at rush hour", "likely", "minor")]

def risk(t):
    return LIKELY[t[1]] * IMPACT[t[2]]

for t in sorted(threats, key=risk, reverse=True):
    print(risk(t), t[0])

Output:

9 fake payment result
6 Orders DB leak
3 app slow at rush hour
2 owner's phone stolen

Fewer numbers with written meanings: two people now get the same answer.

Scale 1 2 3
Likelihood rare: not expected in years possible: could happen this year likely: will probably happen this year
Impact minor: annoyance, quick fix serious: some money or trust lost severe: big money loss or personal data leaked

Problem 5: attack trees

STRIDE asks what can go wrong; an attack tree asks how, step by step, like a burglar planning.

Burglar's plan Attack tree part Meaning
Goal: get inside the house Root What the attacker wants
Door OR window OR roof OR node Any one child works; the attacker picks the cheapest
Copy the key AND know when they're out AND node Every child is needed; their costs add up
"Copy the key" Leaf One concrete step, with a rough cost

Demo 4: the cheapest attack, before and after a fix

tree = ("OR", "free chai", [
    ("AND", "forge payment", [("leaf", "find callback URL", 1),
                              ("leaf", "send fake 'paid'", 1)]),
    ("leaf", "steal owner's phone", 8),
    ("leaf", "bribe the staff", 5)])

def cost(node):
    kind, name, kids = node
    if kind == "leaf":
        return kids
    costs = [cost(k) for k in kids]
    return min(costs) if kind == "OR" else sum(costs)

print("cheapest attack:", cost(tree))
forge = tree[2][0][2]
forge[1] = ("leaf", "fake a signed 'paid'", 100)  # verify signature
print("after the fix:", cost(tree))

Output:

cheapest attack: 2
after the fix: 5

A callback URL is the address on our server that the payment gateway calls to report a result. The fix: the server accepts a payment result only if it is signed with the gateway's secret key (digital signatures come in episode 16), so faking one becomes almost impossible. The cheapest attack rises from 2 to 5, and now "bribe the staff" is the cheapest path: the tree tells you which fix raises the attacker's cost most and what to look at next. (Costs here are rough, relative effort, not money.)

Problem 6: other ways to model (PASTA and LINDDUN)

Method Lens In one line
STRIDE Security, by kind of threat Six questions per element
Attack trees Security, by attacker goal The cheapest path to one goal
PASTA Business risk Seven stages from business goals to risk
LINDDUN Privacy Harm to the people whose data you hold

PASTA, the Process for Attack Simulation and Threat Analysis (described in Risk Centric Threat Modeling, Wiley 2015, by Tony UcedaVélez and M. M. Morana), is a risk-centred method in seven stages:

  1. Define the business objectives
  2. Define the technical scope
  3. Decompose the application (draw it)
  4. Analyse threats
  5. Analyse vulnerabilities (weaknesses)
  6. Model attacks
  7. Assess risk and impact

LINDDUN, developed at KU Leuven (a university in Belgium), finds privacy threats: harm to people even when nothing is "hacked".

Letter Threat ChaiGo example
Linking Joining data together to learn more Orders + phone reveal "Ravi, 8:05 every day, this stall"
Identifying Working out who an anonymous person is Re-identifying an anonymous feedback writer
Non-repudiation Users can't deny something they should be able to Anonymous feedback that is provably tied to them
Detecting Learning something just because data exists or doesn't "No order today: Ravi is away from home"
Data disclosure Collecting or sharing more personal data than needed Sending phone numbers to the stall
Unawareness Users don't know what you keep or can't control it No privacy settings, no explanation
Non-compliance Breaking data-protection law or policy Keeping data longer than the law allows

The fix for many LINDDUN threats: collect less. Does ChaiGo even need the phone number?

Problem 7: what we do about it (mitigations)

For each threat, choose one of four responses:

Response Meaning ChaiGo example
Mitigate Add a control that reduces the risk. A mitigation is any step that lowers risk Verify the gateway's signature on every payment result
Eliminate Remove the feature that causes it Don't store phone numbers at all
Transfer Let someone else carry the risk Insurance; let the payment company store payment details
Accept Decide the risk is small enough, in writing, with an owner "App slow at rush hour: accepted until March, owner: Asha"

Accepting is fine; forgetting is not.

Problem 8: keeping it alive

ChaiGo's January threat model was filed away. By June the app had home delivery and loyalty points, new partners and new flows, and loyalty points could be added by anyone who sent the right message. The model described an app that no longer existed.

  • A threat model is a living document: update it whenever the design changes. A new flow, partner or kind of data means asking the four questions again, just for that change.
  • Question 4, "did we do a good enough job?": was every high risk handled? Is there a test proving the signature check works? Keep the model next to the code and review it like code.
  • OWASP Threat Dragon is a free, open-source threat modelling tool from the OWASP community. It runs as a desktop app or a self-hosted web app, lets you draw the diagram and record threats per element, supports STRIDE, LINDDUN, CIA and more, and is licensed under Apache 2.0. A whiteboard is fine to start.

The whole chain

Step Problem You invented
1 Free chai, found too late Threat modelling, the four questions
2 "An app and a server" Data flow diagram
3 Only the internet checked Trust boundaries, entry points
4 Three guesses STRIDE per element
5 Two rankings Likelihood x impact
6 How, step by step Attack trees
7 Business and privacy harm PASTA, LINDDUN
8 What to do Mitigate, eliminate, transfer, accept
9 A stale model Living document

Common mistakes (and what they print)

Mistake What you see Why it's wrong Fix
if zone[src] == "internet": payment result is never printed Partners can be faked or hacked zone[src] != zone[dst]: check every crossing
Brainstorm from memory 3 threats, no repudiation Whole kinds get missed STRIDE per element: 15 questions
Average five 1-10 DREAD scores Ravi ... -> first: DB leak Subjective numbers disagree Likelihood x impact with written scales
Model once, file it away Loyalty points: anyone can add The design moved on Update on every design change
Trusting the price sent by the app Order accepted at ₹1 Tampering Server looks up the price itself

Mini project: a tiny threat-model helper

Feed in a DFD; get every STRIDE question, with boundary-crossing flows highlighted.

# A tiny threat-model helper: DFD in, prioritised STRIDE questions out
APPLIES = {"entity": "SR", "process": "STRIDE", "store": "TRID", "flow": "TID"}
NAMES = {"S": "Spoofing", "T": "Tampering", "R": "Repudiation",
         "I": "Information disclosure", "D": "Denial of service",
         "E": "Elevation of privilege"}

elements = {"Customer app": ("entity", "internet"),
            "Stall owner": ("entity", "internet"),
            "UPI gateway": ("entity", "partner"),
            "Order API": ("process", "server"),
            "Orders DB": ("store", "server")}
flows = [("Customer app", "Order API", "order + phone"),
         ("Order API", "Orders DB", "save order"),
         ("Order API", "UPI gateway", "payment request"),
         ("UPI gateway", "Order API", "payment result"),
         ("Stall owner", "Order API", "mark as served")]

questions = []
for name, (kind, zone) in elements.items():
    for letter in APPLIES[kind]:
        questions.append((name, letter))
for src, dst, data in flows:
    crossing = elements[src][1] != elements[dst][1]
    for letter in APPLIES["flow"]:
        # boundary-crossing flows get looked at first
        questions.append((f"{data} ({src} -> {dst})" + (" [BOUNDARY]" if crossing else ""), letter))

print(len(questions), "questions in total")
boundary = [q for q in questions if "[BOUNDARY]" in q[0]]
print(len(boundary), "on boundary-crossing flows, starting with:")
for what, letter in boundary[:6]:
    print(f"  {NAMES[letter]:24} {what}")

Output:

31 questions in total
12 on boundary-crossing flows, starting with:
  Tampering                order + phone (Customer app -> Order API) [BOUNDARY]
  Information disclosure   order + phone (Customer app -> Order API) [BOUNDARY]
  Denial of service        order + phone (Customer app -> Order API) [BOUNDARY]
  Tampering                payment request (Order API -> UPI gateway) [BOUNDARY]
  Information disclosure   payment request (Order API -> UPI gateway) [BOUNDARY]
  Denial of service        payment request (Order API -> UPI gateway) [BOUNDARY]

Extend it: add a likelihood and impact to each question you decide is real, and print the top five risks.

Practice

1. Add a delivery partner. ChaiGo adds home delivery through a delivery partner's app. Add it to demo 1b and list the entry points.

Solution
zone = {"Customer app": "internet", "Order API": "server",
        "Orders DB": "server", "UPI gateway": "partner",
        "Delivery app": "delivery partner"}
flows = [("Customer app", "Order API", "order + address"),
         ("Order API", "Orders DB", "save order"),
         ("Order API", "Delivery app", "pickup request"),
         ("Delivery app", "Order API", "delivered!"),
         ("UPI gateway", "Order API", "payment result")]
for src, dst, data in flows:
    if zone[src] != zone[dst]:
        print(f"{zone[src]:16} -> {zone[dst]:16} {data}")

Output:

internet         -> server           order + address
server           -> delivery partner pickup request
delivery partner -> server           delivered!
partner          -> server           payment result

Two new crossings. "delivered!" deserves a Tampering and Spoofing question: could someone fake it to close an order without delivering? The customer's address is new personal data: a LINDDUN question (do we need to keep it after delivery?).

2. Show the cheapest path, not just its cost. Add a "steal OTP" branch (phish the owner, cost 3, AND log in as owner, cost 1) and print the steps of the cheapest attack before and after the signature fix.

Solution
tree = ("OR", "free chai", [
    ("AND", "forge payment", [("leaf", "find callback URL", 1),
                              ("leaf", "send fake 'paid'", 1)]),
    ("AND", "steal OTP", [("leaf", "phish the owner", 3),
                          ("leaf", "log in as owner", 1)]),
    ("leaf", "steal owner's phone", 8),
    ("leaf", "bribe the staff", 5)])

def cost(node):
    kind, name, kids = node
    if kind == "leaf":
        return kids
    costs = [cost(k) for k in kids]
    return min(costs) if kind == "OR" else sum(costs)

def cheapest_path(node):
    kind, name, kids = node
    if kind == "leaf":
        return [name]
    if kind == "OR":
        return cheapest_path(min(kids, key=cost))
    return [step for k in kids for step in cheapest_path(k)]

print(cost(tree), cheapest_path(tree))
tree[2][0][2][1] = ("leaf", "fake a signed 'paid'", 100)
print(cost(tree), cheapest_path(tree))

Output:

2 ['find callback URL', "send fake 'paid'"]
4 ['phish the owner', 'log in as owner']

After the fix, phishing the owner (episode 6) is next. The next mitigation: phishing-resistant login for the owner (episode 29).

3. Classify with STRIDE. For each, give the letter: (a) someone floods the Order API with 10,000 fake orders a minute; (b) a customer edits the request to mark their own order "served"; (c) the Orders DB backup is left on a public file-sharing link; (d) an attacker's server pretends to be the UPI gateway.

Solution

(a) D, denial of service. (b) E, elevation of privilege (a customer doing a stall-owner action); also T, tampering with the request. (c) I, information disclosure. (d) S, spoofing.

4. Choose a response. For each threat, pick mitigate, eliminate, transfer or accept, with one line of reason: (a) phone numbers could leak; (b) the app is slow at rush hour; (c) payment card details could be stolen from our server.

Solution

(a) Eliminate if we don't need phone numbers (or mitigate: encrypt them and limit who can read them). (b) Accept for now, written down with an owner and a review date. (c) Transfer: never store card details; let the payment provider handle them.

Quick quiz

A customer changes the price in their order request from ₹20 to ₹1 and the server accepts it. Which STRIDE threat is this? A. Spoofing B. Tampering C. Repudiation D. Denial of service

Answer

B, Tampering: changing data you shouldn't, which breaks integrity. Fix: the server looks up the price itself and never trusts a price sent by the app.

Interview questions

  1. What is threat modelling, and when should you do it? A structured way to find what can go wrong in a system and decide what to do about it; ideally during design, and again whenever the design changes.
  2. What are the four questions of threat modelling? What are we working on? What can go wrong? What are we going to do about it? Did we do a good enough job?
  3. What is a trust boundary? Give an example. A line where the level of trust changes, e.g. between the internet and your server, or between your server and a payment partner. Data crossing it must be validated.
  4. Explain STRIDE and the property each letter violates. Spoofing/authenticity, Tampering/integrity, Repudiation/non-repudiation, Information disclosure/confidentiality, Denial of service/availability, Elevation of privilege/authorization.
  5. What is STRIDE per element? Applying only the relevant letters to each DFD element type: entities S,R; processes all six; data stores T,I,D (+R for logs); data flows T,I,D.
  6. Why did DREAD fall out of favour? Its 1-10 scores were subjective and inconsistent between people; teams prefer simpler likelihood x impact scales with written definitions, or CVSS for specific vulnerabilities.
  7. How does an attack tree help prioritise mitigations? It shows the cheapest path to a goal; a mitigation that raises the cost of the cheapest path improves security most, and the new cheapest path shows what to do next.
  8. How is LINDDUN different from STRIDE? LINDDUN finds privacy harms to data subjects (linking, identifying, detecting, unawareness...), which can happen without any security breach.
  9. What are the four ways to respond to a threat? Mitigate, eliminate, transfer, accept (accept only with a written decision and an owner).
  10. Why is a threat model a "living document"? Systems change; a model that isn't updated with new features, flows and partners gives false confidence.

Glossary

Term Meaning in plain words Example
Threat Anything that could cause harm (episode 1) A fake payment message
Threat model A structured picture of what can go wrong in a system and what you'll do about it ChaiGo's DFD + threat list
Threat modelling Making and maintaining a threat model A whiteboard session before coding
The four questions What are we working on? What can go wrong? What will we do? Did we do a good job? The skeleton of every threat model
UPI India's instant bank-to-bank payment system Paying ₹20 for chai by QR
API A way for programs to talk to each other ChaiGo's Order API
Data flow diagram (DFD) A drawing of how data moves through a system Boxes, circles, lines and arrows
External entity A person or system outside your control (a box) Customer app, UPI gateway
Process Code that receives data and acts on it (a circle) Order API
Data store Where data rests (two lines) Orders database
Data flow Data moving between elements (an arrow) "payment result"
Trust boundary A line where the level of trust changes (dashed) Internet / our server / partner
Entry point A place where data crosses into your zone The payment result arriving
Callback URL An address on your server that another service calls to report something Where the gateway sends "paid"
STRIDE Six kinds of threat: Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege Microsoft, 1999
Spoofing Pretending to be someone or something else A fake payment gateway
Tampering Changing data you shouldn't ₹20 changed to ₹1
Repudiation Denying an action with no proof either way "I never ordered that"
Information disclosure Data reaching the wrong people Phone numbers leaking
Denial of service Making a system unusable 10,000 fake orders a minute
Elevation of privilege Doing more than you're allowed A customer marking orders served
STRIDE per element Applying only the relevant STRIDE letters to each DFD element type Data flows get T, I, D
DREAD An older scoring scheme: Damage, Reproducibility, Exploitability, Affected users, Discoverability (1-10 each) Dropped by Microsoft as too subjective
Likelihood x impact Risk score from two agreed scales (episode 1) likely (3) x severe (3) = 9
Attack tree A tree of the ways an attacker can reach a goal "free chai" at the root
Root (attack tree) The attacker's goal Free chai
OR node Any one child is enough; take the cheapest Forge payment OR bribe staff
AND node Every child is needed; costs add up Find callback URL AND send fake "paid"
Leaf One concrete attack step with a rough cost "bribe the staff" (5)
PASTA Process for Attack Simulation and Threat Analysis: a 7-stage, business-risk-centred method Starts from business objectives
LINDDUN A privacy threat method: Linking, Identifying, Non-repudiation, Detecting, Data disclosure, Unawareness, Non-compliance "Ravi buys chai at 8:05 daily"
Privacy threat Harm to the people whose data you hold, even without a breach Inferring someone is away from home
Mitigation A step that lowers a risk Verifying the gateway's signature
Mitigate / eliminate / transfer / accept The four responses to a threat Reduce it / remove it / hand it over / live with it, in writing
Living document A document kept up to date as the system changes Updated when delivery was added
OWASP Open Worldwide Application Security Project: a non-profit community making free security resources OWASP Top 10 (episode 36)
OWASP Threat Dragon A free, open-source tool to draw DFDs and record threats (desktop or web, Apache 2.0) Model ChaiGo with STRIDE

Summary

  • Threat modelling finds what can go wrong during design, when fixes are cheap. Answer the four questions.
  • Draw a DFD: external entities, processes, data stores, data flows. Mark trust boundaries; every crossing is an entry point, partners included.
  • Walk every element through STRIDE per element: a checklist beats memory.
  • Rank with likelihood x impact on written scales; DREAD was dropped for being subjective.
  • Attack trees show the cheapest path; fix that first, then look at the next one.
  • PASTA links threats to business risk; LINDDUN finds privacy harm. Often the best privacy fix is to collect less.
  • Give every threat a response: mitigate, eliminate, transfer or accept (in writing).
  • Keep the model alive: update it with every design change. OWASP Threat Dragon helps; a whiteboard is fine.

Next episode: vulnerabilities as a system: CVE, CWE, CVSS, EPSS, KEV, and how to report a bug the right way.

Sources: Threat Modeling Manifesto (threatmodelingmanifesto.org); Wikipedia, "STRIDE model" and "DREAD (risk assessment model)"; VerSprite, "Understanding the 7 Stages of PASTA Threat Modeling"; The Open University (OpenLearn Create), "Privacy Threat Modeling Frameworks" (LINDDUN); OWASP, "OWASP Threat Dragon" project page; Wikipedia, "OWASP" (name change, February 2023). Fetched 28 Oct 2026.