# Hunt Bizlogic

> Turn a money/workflow surface into evidence-carrying CANDIDATES for

- Skill: `encod3d-sec/hunt-bizlogic-2` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx get-skill add encod3d-sec/hunt-bizlogic-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/encod3d-sec/hunt-bizlogic-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: Encod3d-Sec (https://skillmd.com/u/encod3d-sec)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/encod3d-sec/hunt-bizlogic-2

---


# Hunt: Business Logic (golden-image rework)

Turn a money/workflow surface into evidence-carrying CANDIDATES for
business-logic flaws: workflow/state bypass, price tampering, negative
values, coupon abuse, mass assignment, logic races. This skill
produces candidates, never verdicts - findings leave ONLY through the
G1 proof gate (triage).

> Current emphasis (update on wiki harvest): negative-amount tampering
> on two-legged transfers and single-packet race bursts over coupon
> re-redemption classics - models over-index on over-represented old
> methods; the newest harvested technique leads until superseded.

**Assumes `hunt-core`** for the scope gate, two-account rule,
confirmation gate, enumeration limits, stop conditions, wiki protocol,
FIND output, and Deadends. Do not re-derive any of that here.

## Wiki

Hub: [[web-moc]] - Primary page: [[business-logic]] - No payload
arsenal (manual reasoning, zero scanner coverage)
Anchors: [[race-conditions]], [[access-control]]
**REFS:** [[business-logic]], [[race-conditions]]

mcp__wiki-search__query (lex) "business logic flaw workflow state bypass price quantity
tampering coupon refund race condition" via wiki-search MCP - ONLY on
a concrete hint the map above does not cover; not a blanket first
step.

Shared bypass arsenal (blocked implies research, but walk this first): `skills/exploit/hunt/hunt-bizlogic/references/bypass-arsenal.md` - NEW 2025-2026 shapes (single-packet business racing, idempotency-key reuse, TOCTOU, rounding arbitrage, worker gaps) + the defense -> bypass map..

## No scanner finds these

The top-paying bug class and the one with ZERO scanner coverage - all
manual reasoning. Find an assumption the developer made and break it:
that steps happen in order, that values are positive, that the client
cannot change a field, that an action cannot be repeated. Map the
intended workflow first (read the feature, the happy path, every state
transition); the flaw is always the gap between that and what the
server actually enforces.

## Paths (binding - define once at the top of the run notes)

    # seat side (wsl) - engagement tree is DOUBLE-NESTED in VMshare:
    ENG_DIR=/mnt/c/Users/Lenovo/Desktop/VMshare/<eng>/<eng>
    RUN=$ENG_DIR/hunt/bizlogic/<host>
    # VM side (WHERE tools run, same tree through the VMware share):
    ENG_DIR=/mnt/VMshare/<eng>/<eng>
    RUN=$ENG_DIR/hunt/bizlogic/<host>

Corpus and probes live in the VMshare tree; the VM runs tools against
the /mnt/VMshare spelling as user tz; the seat reads the same bytes at
the /mnt/c/Users/Lenovo/Desktop/VMshare spelling. The repo tree targets/
<eng> is admin/ingest only - probe artifacts NEVER land there.

## Transport

Every VM-native command block ships through ONE documented transport:

    cd /mnt/c/Users/Lenovo/Documents/ObisidianVaults/ZTorch/ZTorch && bash scripts/vm-ssh.sh '<command>'

- vm-ssh lands as user tz (NOT root): no root-only paths, no sudo.
- vm-ssh.sh takes the command as ONE argument. Commands containing
  quotes ship as base64: write the script, then run
  `echo <b64> | base64 -d | bash` inside the vm-ssh argument.
- Non-login shells do NOT source profile.d: the PATH scope-shim is NOT
  active. Target-facing fetches MUST use the shim binaries by absolute
  path /opt/scope-shim/bin/{curl,httpx}.
- Shim verdict semantics (verified live): explicit out-of-scope host
  dies rc 126 (never work around it); in-scope passes; UNKNOWN hosts
  get an ADVISORY and the fetch proceeds - an advisory is NOT approval;
  verify against scope.md and self-deny anything not clearly in scope.
- Commands longer than ~2 minutes run DETACHED (bash scripts/vm-scan.sh
  <eng> <target> '<cmd>' or nohup + DONE-marker poll) - the direct
  bridge drops at ~2min and empty output then reads as a dead target.

## Entry gate

All four must pass before Step 1; each is falsifiable:

1. Active engagement exists (repo tree targets/<eng>/active.md) and
   <host> is on the targets/<eng>/scope.md in-scope list. Scope-guard
   is the deny. (targets/ is the repo admin tree; $ENG_DIR holds
   corpus and run artifacts only - see Paths.)
2. hunt-core loaded (skills/exploit/hunt/hunt-core/SKILL.md - it owns
   scope gate, two-account rule, confirmation gate, enum limits; never
   restated here).
3. Producer verified - at least ONE of:
   (a) $ENG_DIR/state.md asset table has >= 1 money/state-machine
   endpoint row for <host> (checkout/payment/refund/coupon/transfer/
   subscription/workflow path); \
   (b) a caido baseline capture walks a target feature flow for
   <host>; \
   (c) the kickoff seeded $RUN/raw/flow-map.md.
   None = dispatch the surface lane first; never probe blind.
4. Toolchain preflight (fails LOUD):

       for t in /usr/bin/jq /usr/bin/python3 \
                 /opt/scope-shim/bin/curl; do
         [ -x "$t" ] || { echo "MISSING TOOL: $t"; exit 1; }
       done

Races fire through the Burp seat (Turbo Intruder via send_to_intruder
/ the Burp MCP), never a hand-rolled parallel VM loop.

## Checklist (mandatory)

Copy checklist.md (this skill's dir) to
`$ENG_DIR/hunt/bizlogic/<host>/bizlogic-checklist.md` at run start.
Tick boxes as steps finish; unchecked at stop = UNCHECKED lane, re-run
from the first unchecked step. The SKILL.md text and the checklist
header agree byte-for-byte on that copy target.

## Nudge

Review-skill re-injection text (pinned for vocabulary match; NOTE: the
completion-gate script itself emits a different generic nudge - see
scripts/completion-gate.py NUDGE - both strings mean the same thing:
resume at the first unchecked box):

    Your work was just reviewed by the review skill and it was found
    that you either missed a step of analysis, or didn't generate an
    artifact of sufficient proof. Look at the markdown based checklist
    and the output for each step, find what you missed, and complete
    that step.

On this nudge: resume at the FIRST unchecked box of
$ENG_DIR/hunt/bizlogic/<host>/bizlogic-checklist.md - never restart
the run from zero. REVIEW may only be ticked after every earlier box
is ticked.

## Methodology

**Setup:** two accounts per hunt-core where the flaw is cross-actor;
one account suffices for pure value or state tampering (note it in the
run ledger as "N/A: single-account suffices" - never silently). Drive
load-bearing requests through Burp Repeater for operator visibility
(`Skill(hunt-burp)`).

**Rank before testing.** Money and state-machine endpoints pay;
cosmetic ones do not: (1) checkout/payment - client-supplied price,
total, tax, currency, shipping anywhere the server should recompute
and instead trusts; (2) refund/coupon/gift card/store credit -
re-redemption, stacking, negatives, refund exceeding purchase; (3)
multi-step workflows - checkout, transfer, signup, KYC, password
reset, subscription: skip, replay, reorder; (4) quantity/price fields
- negative, zero, overflow, decimal/rounding; (5) state transitions -
ship before pay, use before verify.

### Step 1 - Flow map

Enumerate every step and state of the target feature. Note each
parameter and which server check governs it - the flaw is a check the
client can reach around. Row schema `step | params | governing check |
source`:

    { \
      echo "1 cart-add | item_id, qty | qty>0 validated | caido baseline"
      echo "2 checkout | total, currency | server recomputes total | probe"
    } >> "$RUN"/raw/flow-map.md

### Step 2 - Step/state bypass

Skip a step (POST straight to the final endpoint), replay an earlier
step, run steps out of order, reuse a one-time token, reach step N
without completing N-1. Every attempt = one JSONL row + full req/resp
pair under probes/raw/.

### Step 3 - Value tampering

    quantity = -1            # negative -> credit / refund
    price / amount = 0.01    # client-supplied price
    currency swap            # pay weak, credited strong
    integer overflow / very large qty
    decimal / rounding (0.001 * 1000)

On a two-legged transfer, a negative amount flips BOTH legs (sender
gains, recipient debited) and passes the insufficient-balance check by
construction; re-read BOTH balances afterward as the impact proof
[[business-logic]].

### Step 4 - Repetition / limits / logic race

Apply a coupon twice, redeem a gift card twice, exceed a per-account
limit. When the limit is a check-then-act with no lock, fire a SMALL
concurrent burst at the single endpoint (logic [[race-conditions]]) so
several requests pass the check before any commits. Keep the burst
bounded: a handful of parallel requests is the proof, honor no_dos,
never a sustained flood. This is a bounded active proof, not object
enumeration - the 5-to-20 identifier ceiling does not apply, but the
RoE rate cap does. Send the request to Turbo Intruder via
send_to_intruder / the Burp MCP and fire it with a single-packet or
synchronized-gate script so the operator watches the race live.

Read the negative BEFORE re-racing: a final state of exactly
`start - successes*unit`, or bursts that land at the cap with only
TRAILING completions accepted, prove a serialized check-then-write;
record the class closed and switch vectors ([[race-conditions]]).

Two rules that decide whether a race verdict is even readable:

- **The verdict is the POST-STATE read, never the response pair.** Both
  requests returning success tells you nothing - fetch the affected
  object fresh and compare against the serial baseline. Both-success
  PLUS a wrong final state (e.g. a delete that acked success but the
  object survived) is the defect; both-success with the correct final
  state is atomic. Record the post-state read for every raced surface.
- **Precheck object-identity stickiness first.** Fire the same op twice
  serially and read the object id in each response: if every replay
  mints a FRESH object (per-request cart/session scoping), the two
  parallel requests hit different objects and every race verdict on
  that surface is invalid - the trivial split is indistinguishable
  from a win. Race only surfaces whose object identity is sticky
  across replays.

### Step 5 - Mass assignment / parameter injection

Add fields the UI never sends (isAdmin, role, balance, verified,
discount, userId) to JSON or form bodies; observe a privilege or state
change.

### Step 6 - Trust-boundary confusion

Values the server should compute but trusts from the client (total,
tax, role, KYC status, account tier); flags re-sent and re-trusted on
a later request.

### Step 7 - Identity / authorization logic

An action allowed for the wrong account state (an unverified user
performing a verified-only action) or against another user's object
(-> [[access-control]] / hunt-idor). Rows cite account state vs the
action's required state.

### Step 8 - Rejected-value representations (bypass ladder)

A rejected tamper is not a closed door. Retry the same value in a
representation the server parses but the validator missed: an
alternate field the server also reads, parameter pollution
(`price=10&price=0.01`), a nested wrapper (`{"item":{"price":0.01}}`),
a type change (string vs number, array vs scalar), sign and precision
tricks (`-0`, `1e-2`, trailing decimals), or re-sending a
server-computed field an earlier step trusted. Reorder the steps so
validation runs before the value is set. One row per representation
tried with outcome; the artifact is non-empty even when all fail.

### Step 9 - Exit artifact (candidates)

Merge probe JSONLs (union, truncate+dedupe on endpoint+method+class;
keys class|host|endpoint|method|evidence|confidence|next).
candidates.md: human table + probe counts, EVERY class section present
("no hits" where true; a missing class section = failed lane).
Pointer $ENG_DIR/hunt-bizlogic-<host>.md:

    BIZLOGIC-HUNT-DONE statebypass=<n> values=<n> race=<n>
    massassign=<n> trust=<n> identity=<n>

Plus: _requests.md rows (lane = hunt-bizlogic), state.md asset rows
(access=exploit-candidate, source=hunt-bizlogic), Deadends rows with
the WHY (what the server enforced).

Every probe JSONL row: {class, host, endpoint, method, evidence
(absolute probes/raw/ path), observed, confidence}. Every request/
response pair under $RUN/probes/raw/ (filename = sha256 of
method+path+body).

## Chaining

Logic flaws compound. A price or quantity tamper that touches another
user's cart is logic + IDOR (hunt-idor); a coupon or limit bypass that
only works under concurrency is logic + race ([[race-conditions]]).
Chain them and say so in the title - "race-condition coupon
re-redemption" reads bigger than "coupon bug".

## Confirmation gate

**NOT confirmation:** the app accepted an odd value; a 200 on a
tampered request; the tampered field echoed back; an order or total
that merely DISPLAYS wrong on your screen; a coupon that "applied"
without the charge changing.

**IS confirmation:** the unintended end-state is realized and verified
downstream - a negative or inflated balance that persists, a purchase
completed at the free or discounted price (order confirmed, payment
captured at the tampered amount), a workflow step skipped AND its
downstream effect confirmed (account provisioned, funds moved, access
granted). For a race, the limit is actually exceeded (two redemptions
both settled). Re-verify in a clean session, and confirm from the
state only the successful abuse produces, not from the request the
server merely accepted.

## Validation

- Proof = the economic/state effect demonstrated TWICE with a paired
  control: the attack order applies the flaw AND a control order
  without it behaves normally. One lucky order is an anecdote.
- Counterevidence: reconciliation/refund reversal may catch the effect
  later; note the window in the FIND's severity_change_conditions.

## False Positives

- Sandbox/test-mode amounts and sandboxes with fake gateways.
- Client-side-only "reuse" the server already deduplicates.
- Race "won" against a dev replica with different locking.
- Quantity/currency overflow the backend rounds or rejects at
  settlement.
- Feature-not-bug: bulk discount stacking that is the documented
  promotion.

## Cross-routing

- hunt-api when the abuse needs endpoint mechanics (verbs, mass
  assignment).
- hunt-injection when the root cause is a parser (unit mismatch, type
  juggling).
- Not this skill: plain cross-account object access (hunt-idor).

## Severity

Rated on realized impact per hunt-core.

| Outcome | Typical |
|---|---|
| Direct financial theft, auth bypass, unlimited privilege | critical |
| Discount / refund abuse, quota bypass with money impact | high |
| Limited abuse needing preconditions | medium |

## Deadends

    Append: - [ ] logic <feature> on <host> -- server recomputes
    price/total, enforces the state machine, ignores extra fields,
    idempotency keys present; race lost after bounded burst

Record what the server enforced, so the next pass does not retest a
solid boundary.

## N/A escapes

- "N/A: no money endpoints on host"
- "N/A: no multi-step workflow"
- "N/A: no race-capable endpoint"
- "N/A: single-account suffices" (cross-actor rule waived for pure
  value/state tampering - noted, never silent)
An N/A tick is a claim with a reason, never a silent pass. Identical
strings in SKILL.md and checklist.md.

## Bitter-pill variant

When the kickoff designates this run freehand: skip the checklist copy
and numbered steps, one freehand pass over the flow map + captured
traffic, output lands ONLY in $RUN/analysis/bitter-pill.md (tried /
found / dismissed, every claim carries file:line or request evidence).
Never edits structured outputs. Proof gates still apply - freehand
never skips proof. Declare with one _requests.md row (lane =
hunt-bizlogic-bitterpill) so completion-gate routes to this artifact
contract instead of the checklist ledger.

### Depth walk (mandatory)

Walk EVERY applicable row of the payload arsenal page cited above.
Record each row in `$RUN/coverage-depth.md` as a table
`| row | state | evidence |` where state is `probed`, `blocked`, or
`N/A`, and evidence is a probe-pair path or a Deadends.md line. A bare
`probed` with no evidence reference fails the completion gate
(NEEDS-REVIEW). N/A rows cite why (surface shape forbids it).

Blocked implies research: before any Deadend is claimable on a blocked
row, (a) walk the arsenal page's bypass-ladder rows for that control
class, and (b) run one wiki query AND one `mcp__wigolo__search` for the
specific tech-plus-control bypass. Results, or a genuine null, land in
`coverage-depth.md`. "No research tried" is not a claimable state.

## Exit artifact + handoff

ONE exit artifact set: $RUN/candidates.jsonl (machine) +
candidates.md (human) + $ENG_DIR/hunt-bizlogic-<host>.md (pointer with
BIZLOGIC-HUNT-DONE + counts). The consumer (triage) finds at $RUN:
raw/flow-map.md, probes/*.jsonl, probes/raw/*, candidates.{jsonl,md}.
Findings leave ONLY through G1 (triage). Distill confirmed GENERIC
patterns: `python3 scripts/wiki-stage.py --kind technique --slug
<slug> --target-page techniques/web/business-logic.md`.

## Stop conditions

Terminal states complete (probed | N/A with reason | deadend row
written), nothing written into skill dirs (skills/exploit/hunt/
hunt-bizlogic/ stays untouched), no unchecked boxes above REVIEW.
hunt-core stop conditions fire unchanged.

## Attack surface

**APPROACH:** Map the intended workflow, then break a developer assumption: client-supplied price/total at checkout, refund/coupon re-redemption and negatives, step skip/replay/reorder, quantity overflow, and out-of-state transitions; bounded concurrent burst for check-then-act races.
**AVOID:** An odd value accepted, a 200 on a tampered request, the field echoed back, or a wrong total that only DISPLAYS is NOT confirmation - the unintended end-state must be realized and verified downstream (balance moved, order captured at the tampered price).

