How to Build and Use an Attack Tree for Web Security Analysis
An attack tree is a hierarchical model that starts with an attacker’s goal and breaks it into alternative paths and prerequisite conditions. An OR branch means one alternative can satisfy the parent goal; an AND branch means every listed condition is needed. The structure helps turn vague attack ideas into reviewable system conditions and control checks. It does not prove that every path was found or that risk has been measured numerically.
How to Build and Use an Attack Tree for Web Security Analysis
An attack tree is a hierarchical model that starts with an attacker’s goal and breaks it into alternative paths and prerequisite conditions. An OR branch means one alternative can satisfy the parent goal; an AND branch means every listed condition is needed. The structure helps turn vague attack ideas into reviewable system conditions and control checks. It does not prove that every path was found or that risk has been measured numerically.
An attack tree does not replace a full threat model. First define the system boundary and data flows, then choose a specific asset and harmful outcome to analyze. For the wider workflow and how STRIDE fits with other prompts, see the threat-modeling guide.
Start with a goal and decompose it
The root is a concrete result an attacker wants. “Attack the web app” is too broad; “read a private document belonging to another tenant without authorization” names an asset and harm. Child nodes describe ways to reach the result or conditions those ways require. Leaves are actions or conditions that the analysis will not further decompose; write them so they can be checked, and note whether you stopped because of scope or missing information.
OR (alternatives): any one child path can achieve the parent. A private file might be obtained through an authorization flaw, an improperly broad share link, or a compromised account.
AND (all required): every child condition must hold for that path. For example, exploiting an API authorization flaw may require an account that can reach the document API, the target document identifier, and a server that does not verify the requester’s tenant rights for that document.
The following is a hypothetical example to show the logic. It is not a description of a real service, vulnerability, or test result.
Goal: Read another tenant's private document without permission [OR]
├─ Use an API authorization flaw [AND]
│ ├─ Obtain an account or route that can reach the document API
│ ├─ Obtain the target document identifier
│ └─ Server does not check requester-to-document tenant/permission
├─ Use an over-broad share link [AND]
│ ├─ Obtain a valid share link
│ └─ Link grants access beyond the intended recipient, time, or document
└─ Compromise an account or session authorized for that documentThis tree does not assume that guessing an identifier is enough. Access to an identifier alone may not matter; actual authorization and sharing rules determine whether a path works. The defensive review asks whether each AND condition is necessary and whether another control breaks an OR path.
A practical workflow
1. Set scope and the protected outcome
Choose the feature, data, user roles, external connections, and environments in scope. A single tree is easier to review when it has one main harmful outcome. Split a broad goal such as “document breach” into confidentiality loss, unauthorized modification, or service disruption. Use the system model or data-flow diagram to identify relevant components and boundaries.
2. Write branches as observable actions
Brainstorm distinct ways to reach the goal. Use actions such as “use a document API authorization flaw,” “abuse a share link with excessive scope,” or “misuse an operator account.” Keep each leaf specific enough to connect to a control or follow-up question. If actor identity or intent is unknown, do not present it as a fact; record the assumed access level separately.
3. Check the AND/OR logic
Ask whether one child is sufficient or all children are required. Marking a true alternative as AND can understate the path; marking dependent conditions as OR can make an incomplete path appear sufficient. Add a short reason for each grouping. A basic tree decomposes goal logic; it does not automatically model event order like a sequence diagram.
4. Separate evidence, assumptions, and open questions
“The session is stolen” is not a fact until supported. For important nodes, record the source and date, and distinguish confirmed design facts, observed events, analyst hypotheses, and unanswered questions. A tree is a way to reason about structurally possible paths, not evidence that a path exists in the deployed system.
5. Connect leaves to controls and verification
Map each leaf to prevention or detection controls. For example, “the server does not verify the requester’s tenant rights for a document” suggests checking server-side object authorization and verifying that a cross-tenant request is denied. A share-link branch may prompt review of recipient scope, expiration, revocation, and exposure in logs. A control’s presence does not make a leaf impossible by declaration: identify where it is enforced and what test or evidence will confirm it. Assign an owner to follow-up work.
When to assign cost or likelihood values
Attributes such as required access, effort, cost, detectability, or feasibility can help compare paths under stated conditions. Record what each value means, its source, date, and assumptions. Without that context, a number can look precise while remaining a guess.
Do not turn simple arithmetic into an overall risk score. In a conventional tree, the cheapest OR alternative may represent the parent cost, while an AND path may sum its required costs. This is meaningful only if costs are measured on the same basis and are genuinely independent and additive. Dependent conditions can make a sum misleading. Probabilities also cannot be added or multiplied merely from the AND/OR shape; that needs a justified probability model and evidence. When those are unavailable, keep a qualitative comparison and state what is unknown.
If you assign values, specify the assumed attacker or access conditions, distinguish observed data from expert judgment, and revisit values as controls or evidence change. Values cannot compensate for missing branches or vague scope.
Common mistakes and limits
A vague root: “hack the system” mixes assets and harms. Name the protected outcome.
Assuming completeness: human analysis can miss paths. Invite review from people with different roles and update the tree when evidence changes.
Listing vulnerability names without a path: “SQL injection” alone does not explain which data or goal is affected, nor which control to verify.
Leaving leaves abstract: decompose “account compromise” enough to identify the boundary, asset, and evidence to check, without inventing unverified attack details.
Treating scores as objective risk: values depend on assumptions and models. Show both.
Using the tree as a control checklist: the tree decomposes paths; implementation state, detection, operational readiness, and risk acceptance need separate review.
An attack tree is not a way to predict an attacker’s identity. It makes the paths and prerequisites for one harmful outcome explicit so a team can connect them to real permissions, data flows, control evidence, and review work.
Sources
NIST CSRC Glossary, Attack tree.
Bruce Schneier, Attack Trees, Dr. Dobb’s Journal (1999).
NIST, Threat Modeling for Cloud Infrastructures.
OWASP, Threat Modeling Cheat Sheet.