--- name: chain-reasoning description: Build and validate compatible vulnerability chains, prioritize newly reachable boundaries, and distinguish demonstrated impact from hypothetical escalation. --- # Evidence-backed chain reasoning A primitive is a capability under specific conditions. It is not a severity label. Connect demonstrated capabilities to protected operations through an explicit graph, using `investigation-control` for clue continuity and `real-world-validation` for controls and proof. Continue already-authorized investigation without repeated permission requests; a new host or capability does not expand scope. Confirm the next action is permitted before executing it. ## Represent each edge ```text Edge ID / source clue or finding: Actor, tenant, session, origin, version/configuration: Capability observed, constraints and exact evidence: Output obtained -> prerequisite required by next edge: Next protected operation and expected security boundary: Controlled fixture / baseline / negative control: Next discriminating experiment / budget / stop condition: State: proposed | reachable | tested-supported | refuted | blocked ``` Require compatible prerequisites across all edges. Check principal continuity, cookie/token scope, read versus write authority, user interaction, lifetime, origin, network reachability and configuration. A leak from an admin-only debug page is not an unauthenticated entry point. Public DNS does not prove access to an internal service. A credential-looking string does not prove a valid secret. ## Choose follow-up by what the primitive actually permits | Primitive | Useful follow-up within existing authorization | Insufficient evidence | |---|---|---| | Error/config disclosure | Confirm a reachable feature/version or owned private configuration boundary | Automatically assigning Low/Medium severity or assuming an internal service is accessible | | Object read | Compare another owned tenant's private canary and relevant export/download path | Guessable IDs, public fields or same-owner objects | | Object/field write | Verify a documented forbidden change on a disposable owned fixture, then read persisted state | Changing an ordinary writable `display_name` and calling it mass assignment | | File upload/storage | Trace who retrieves the object, how it is interpreted and whether access control holds | Upload accepted, renamed extension, or inert payload stored | | SSRF-like callback | Distinguish DNS, HTTP fetch and an actual authorized protected-resource consequence | Treating a callback alone as internal read or credential access | | Credential exposure | Check source, environment, audience and narrowly permitted capability with owned data | Inferring broad account takeover from the string or enumerating unrelated records | | Workflow/race | Identify invariant, run a sequential control and verify the settled controlled result | Several success responses, transient duplicate UI, or a production financial loss | | Agent instruction following | Correlate actual tool call, principal and resulting controlled state | A model saying it performed an action | ## Demonstrate the requested consequence Once an edge is proven, stop redundant proof. Reprioritize independent coverage or test another necessary edge if it is in scope and needed to establish the requested consequence. Use reversible fixtures, small canaries and bounded concurrency. A new permission requirement or excluded action blocks that edge; preserve the hypothesis and continue permitted work. Do not truncate a legitimate authorized chain merely because its first edge was interesting. Do not deepen a chain solely to inflate severity. Decide from the engagement objective, satisfied prerequisites, safety limits and sufficient proof. ## Report the graph honestly Separate: - Demonstrated path: tested entry point, compatible actor context, verified edges and observed end effect, each linked to captured evidence. - Conditional path: untested edges, missing prerequisites and what would establish or refute them. Exclude hypothetical effects from the demonstrated severity. - Remediation: the earliest enforceable trust boundary and any independent controls that must also be corrected. Deduplicate shared causes without hiding separately exploitable boundaries. Report exact affected fixtures and tested breadth. One instance does not prove all tenants, routes or records are affected. A failed higher-impact edge does not invalidate an independently proven lower-impact finding. --- ## Edge-type taxonomy Classify every edge before connecting it. The type determines what compatibility means and what evidence closes the edge. | Edge type | Capability it carries | Compatibility requirement | Closing evidence | | --- | --- | --- | --- | | Information | Knowledge: a secret value, internal name, version, schema | The information must be *usable* — right audience, not expired, not a decoy/honeypot value | The value is consumed successfully by the next edge, on your own fixture | | Identity | A session, token, credential or role the attacker now acts as | Token scope, audience and lifetime must cover the next operation; principal must not change mid-chain | An authenticated action performed as that identity on a controlled object | | Network | Reachability: SSRF, open proxy, internal DNS, port access | The reachable service must be the one the next edge needs, from the fetching principal's network position | A response from the target service itself, not a callback to an attacker listener | | State | A stored value or object another principal will later consume | The consumer must actually read that object, in that state, within its lifetime | The downstream effect observed on the consumer side (canary fires, state changes) | | Execution | Code or command execution in some context | The execution context's privileges and network position bound everything after it | A controlled, reversible action (canary file, DNS lookup, marker row) — never a destructive one | | Authorisation | A check that is missing or misapplied on a specific operation | The missing check must be on the operation the chain needs, for the chain's actor | The operation succeeding on a disposable owned fixture with a negative control beside it | | Economic | A value invariant broken: price, balance, quota, race window | The settled state must persist after reconciliation, not just display | Post-settlement read of the controlled account/object showing the durable effect | | Time | A window: token lifetime, race interval, cache TTL, job schedule | Downstream edges must execute inside the window, including their setup time | The full sequence completed inside one measured window, repeated once | An edge whose type is misread is the usual chain failure: an *information* edge (a callback fired) reported as a *network* edge (internal service read), or an *identity* edge (a token string) reported without ever performing the authenticated action that closes it. ## Worked end-to-end example chain Scenario (all steps inside program scope, on controlled fixtures): an in-scope web app lets users register a webhook URL that the server fetches when an order changes. **Edge 1 — Network (SSRF reachability).** State: tested-supported. Fixture: webhook URL pointing at an authorised internal test service the program lists in scope. Observation: the order-change event produced a server-side fetch whose response timing and the test service's log show a real HTTP GET from the app server — not merely a DNS resolution to an attacker listener. Output: confirmed server-side fetch with attacker-chosen path. Prerequisite for next edge: the fetch can reach the link-local metadata address from the server's position. **Edge 2 — Information (metadata credential material).** State: tested-supported. The webhook URL is set to the metadata path that returns temporary instance credentials. Observation: the response body, delivered to the webhook event log the user can read, contains an access key ID, secret and session token with a six-hour expiry. Compatibility check: audience is the cloud API, lifetime six hours — long enough for edge 3, and the clock starts now. Output: a live credential set. (The chain stops being hypothetical here only because the body was actually returned; a 200 with an empty body would leave this edge proposed.) **Edge 3 — Identity (credential use against own resources).** State: tested-supported. Using the credentials, list the storage buckets visible to the role and read **one object: a canary file placed beforehand in a bucket the test account owns**. Observation: the canary contents return intact. Deliberately not done: enumerating other buckets' contents or reading any object not created for this test. Output: demonstrated read primitive over the role's storage scope. **Edge 4 — Impact statement.** Demonstrated end effect: an unauthenticated-in-spirit feature (any user who can register a webhook) yields cloud credentials able to read every object the instance role can read. Severity is assigned from that demonstrated read scope and the role's known permissions — Critical if the role's policy is broad, and the report states the policy evidence rather than asserting it. **Refuted branch, kept honest:** an earlier hypothesis — the same fetch reaching the internal admin service on port 8080 — was tested and refuted (connection refused from the fetch service's network segment). It appears in the report as a refuted edge, not silently dropped: a failed higher edge does not invalidate edges 1–3, and the demonstrated path stands on its own. ## Prioritisation and validation discipline - **Cheapest discriminating edge first.** When several edges are proposed, test the one whose refutation kills the most of the graph for the least budget — usually the compatibility-critical middle edge, not the glamorous final one. - **One state change per edge.** If two edges flip in a single experiment, neither is proven; rerun with fixtures that isolate them. - **Repeat the closing edge.** The final effect is reproduced once independently before reporting; intermediate edges need their controls, not repetitions. - **Budget stop conditions per edge**, written before testing: max requests, max elapsed time, and the observation that refutes it. An edge that cannot state its refutation condition is not ready to test. ## False-positive traps - **Hypothetical stitching:** two real findings joined by an edge nobody tested ("the leaked key *could* be used to…"). The join is the claim; test it on your own fixture or label the path conditional and exclude it from severity. - **Principal drift:** edge 1 proven as an admin, edge 2 as a regular user, reported as one attacker. Restate the actor on every edge; a chain that needs two principals is two findings. - **Expired-window chains:** each edge works, but never inside the shared lifetime (token expires before the queued job runs). Measure the sequence end to end once. - **Version/config drift:** edges proven against different deployments (web vs mobile API, v1 vs v2) whose configurations differ. Pin the version on every edge. - **Canary self-deception:** the "downstream effect" was your own request returning, a cached response, or an unrelated periodic job. Correlate with timestamps and unique per-edge markers. ## Reporting checklist ``` [ ] Every edge lists actor, tenant, session, origin, version/config [ ] Each edge classified by type; closing evidence matches the type [ ] Compatibility checked across edges: principal, scope, lifetime, read/write authority, network position [ ] Demonstrated path and conditional path reported separately; severity drawn from the demonstrated path only [ ] Refuted edges recorded with their refuting observation [ ] Closing effect reproduced once independently [ ] All proof on controlled fixtures; no real-user data at any edge [ ] Remediation names the earliest enforceable boundary, plus any independent controls that must also be fixed [ ] Per-edge budget/stop conditions stated; untested edges listed as gaps, not implied ``` ## Chain handoffs - Single-edge findings that stand alone → their owning `hunt-*` skill for the deep write-up; the chain adds reachability, not a rewrite - Clue continuity across a long investigation → `investigation-control` - Final severity, eligibility and proof review → `finding-validation` and `real-world-validation` - New surface discovered mid-chain (an internal service, a new consumer) → back to `recon` for that surface before its edges are proposed