agentleFS
fennihfennih/hunterkit/business-logic/SKILL.md

business-logic

Skill0 starsChanged 7 days agoMITView on GitHub

Focused hunt for business logic flaws on a web target: price/quantity tampering, workflow bypass, negative/edge values, coupon and limit abuse. Use when the focus is logic bugs, e-commerce/payment flows, or 'abuse the intended behavior of X'. Not for race conditions (use race), access control between users (use access-control), or injection (use the payload skills).

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use nosql-injection.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • yaklangSkill

    nosql-injection

    NoSQL injection playbook. Use when MongoDB-style operators, JSON query objects, flexible search filters, or backend query DSLs may allow data or logic abuse.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not complete real purchases/transfers unless the user explicitly allowed it.

    line 26
  2. Distinctive:

    Every finding needs: the intended business rule (state it), the abuse, and reproduced requests proving the rule break.

    line 28
  3. Very specific:

    Write findings to findings/logic-<date>.md:

    line 63
  4. Very specific:

    If the abuse requires reading another user's object → lead for access-control.

    line 77

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Business Logic Flaws

When to use

  • "Hunt logic bugs on X", "test the checkout of X", "can I get X for free / bypass the limit"
  • OWASP coverage: A04 Insecure Design, API Top 10 API8 (BFLA-adjacent logic abuse)

When NOT to use

  • Authorization between users (use access-control)
  • Pure injection (use the payload skills: sqli, ssti, xss, cmd-injection)
  • Race conditions needing concurrency (use race)

Inputs

  • Target: the business flow to test (checkout, coupon, subscription, voting, referral, withdrawal, booking, transfer)
  • Accounts: one or two test accounts; small real value at stake only if the user allows (ask before spending money)

Ground rules

  • Do not complete real purchases/transfers unless the user explicitly allowed it; abort at the last safe step and document.
  • Race tests: small bursts (5–20 parallel requests), then stop and analyze.
  • Every finding needs: the intended business rule (state it), the abuse, and reproduced requests proving the rule break.

Methodology

1. Model the intended rules

For the target flow, write down the invariants the business assumes: "one coupon per account", "price = server-side value", "a vote counts once", "withdrawal ≤ balance", "quantity > 0", "coupon valid once globally". You need the rule to prove the break.

2. Parameter tampering

  • Client-controlled values sent to the server: price, quantity, discount, currency, tax, total, plan, interval.
  • Negative values (quantity=-1, -5.00 money), zero, huge values, float precision (0.1+0.2 style), decimal places beyond allowed, scientific notation, comma vs dot.
  • Currency/units mismatch: pay in cents as dollars, currency switch after quote.

3. Workflow bypass

  • Skip steps: jump to step 3 URL/payload of a 4-step flow; reuse a session artifact from an incomplete flow.
  • Replay: repeat a completion step (double redemption, double points), repeat with modified params.
  • Order manipulation: apply coupon after price confirmation; change items after payment initiation.

4. Limits and quotas

  • Rate-limit style limits (free uses per day, trial restarts): reset via new email +tag, delete/recreate account, device/IP rotate — only your own accounts.
  • Trial/subscription: downgrade after upgrade, keep premium features; cancel-then-use same second.

5. Coupon / promo / referral

  • Coupon reuse per account/global, stacking, expired coupons, format bruteforce on small pattern spaces (a few dozen max, then stop), case sensitivity, whitespace/Unicode tricks on codes.
  • Single-use enforcement under concurrency → hand off to race (it owns burst mechanics and proof).

6. State and consent

  • OTP/verification steps: does verifying email A then changing to email B keep verified state? Accept terms later bypassed?
  • Export/report endpoints: can totals be tampered client-side?

Grey box bonus (source available)

  • Trace the server-side validation for each tampered param with Semgrep/grep: find where price/quantity is trusted from the client (p/owasp-top-ten, mass assignment patterns) and confirm live.

Reporting

Write findings to findings/logic-<date>.md:

### [SEVERITY] Title
- Flow & intended rule: one line stating the business invariant
- Endpoint(s): method + URL
- CWE: CWE-840 / CWE-367 (race) / CWE-841
- Evidence: request(s) + response/state proof (e.g. two successful redemptions)
- Reproduction: numbered steps
- Impact: money, inventory, fairness, abuse at scale

Focus discipline

If the abuse requires reading another user's object → lead for access-control. If it requires SQL/template/command payloads → sqli / ssti / cmd-injection.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.