agentleFS
AetherdzAetherdz/huntpack/skills/hunting/business-logic-hunter/SKILL.md

business-logic-hunter

Skill5 starsChanged 4 months agoMITView on GitHub

EXECUTION MATRIX for business logic bugs — highest bounty category. Each pattern has SIGNAL → TEST → CONFIRM → KILL + response-driven next actions + sibling analysis. No theory, just commands. Load after app-model built. NOT for OWASP vulns (use web2-vuln-classes).

  • Sends data out

The file

Files
SKILL.md

BUSINESS LOGIC HUNTER — EXECUTION MATRIX + RESPONSE-DRIVEN

EXECUTION MATRIX

PatternSignalTestConfirmKillResponse-Driven Next Action
Subscription Abuseplan_id in JS/responsecurl -X POST /api/plan -d '{"plan_id":"enterprise_premium"}' after trial expiresPremium features accessible post-expiry401/403 on feature endpointplan_id accepted → test trial reset via different account, test plan downgrade keeps features
Race ConditionMutate balance/stock/claimfor i in {1..30}; do curl -X POST /claim -d "code=WELCOME20" &; done; waitAll 30 return 200 with discount appliedDB UNIQUE constraint violationRace confirmed → verify BOTH changes persisted in ledger → financial impact chain
Coupon/Discountcoupon_code fieldcurl -X POST /checkout -d '{"coupon":"WELCOME20","quantity":-1}'Negative quantity reduces totalCoupon one-time lockNegative works → test stackable coupons, unlimited quantity → chain to free goods
Wallet/Balancebalance field in responsecurl -X POST /withdraw -d '{"amount":100}' + curl -X POST /withdraw -d '{"amount":100}'Both succeed, balance -200Atomic DB transactionRace works → check ledger for double spend → test on transfer between users
OTP BypassOTP step in signup flowSkip OTP step: curl -X POST /signup -d '{"email":"x@x.com","password":"X","skip_otp":true}'Account created without verificationServer-side OTP checkOTP skip works → test changing email BEFORE OTP verification → ATO chain
IDORSequential IDs in URLfor i in {1..100}; do curl /api/order/$i -H "Cookie: SESSION=A"; doneOther user's order data returned403 for all IDsIDOR confirmed → test PUT/DELETE on same pattern, test nested IDs
Role Escalationrole/permission fieldcurl -X PUT /api/team/member -d '{"user_id":TARGET,"role":"admin"}'Target is now adminServer enforces role hierarchyRole escalation works → test is_admin, permissions[], plan fields
Mass AssignmentUser model fields in APIcurl -X PATCH /api/profile -d '{"role":"admin","credits":9999}'Role/credits field updatedWhite-list validationMass assignment works → find ALL writable fields, test on other endpoints
Workflow BypassMulti-step flowcurl -X POST /order/finalize -d '{"step":"payment"}' after skipping step 2Order created without completing step 2State machine validationBypass works → test reordering steps, repeating steps, skipping to ANY step
Refund Abuserefund_amount/order_idcurl -X POST /refund -d '{"order_id":"X","amount":9999}'Refund > purchase amount approvedServer caps refund to paidRefund > paid works → test same refund multiple times, test refund after cancellation
Cross-Tenantorg_id/workspace_idcurl /api/workspace/OTHER_ID/invoices -H "Cookie: SESSION=A"Tenant A reads Tenant B invoicesWorkspace boundary checkCross-tenant works → test all endpoints with other org IDs, test invite acceptance from other org

SIBLING ENDPOINT DISCOVERY FOR BUSINESS LOGIC

Signal EndpointSiblings to CheckWhat to Expect
/api/checkout/api/checkout/apply-coupon, /api/checkout/shipping, /api/checkout/reviewDiscount logic may be separate from payment, weaker validation
/api/subscription/api/subscription/cancel, /api/subscription/reactivate, /api/plan/changeCancel→reactivate may bypass payment check
/api/wallet/withdraw/api/wallet/transfer, /api/wallet/deposit, /api/wallet/balanceTransfer may lack same validation as withdraw
/api/orders/{id}/refund/api/orders/{id}/cancel, /api/orders/{id}/return, /api/orders/{id}/invoiceCancel+refund race, partial refund abuse
/api/team/invite/api/team/member, /api/team/role, /api/workspace/{id}/memberInvite→role escalation chain
/api/user/email/api/user/password, /api/user/profile, /api/user/deleteEmail change without verify → ATO chain

RESPONSE-DRIVEN FLOW

Found business logic surface?
├─ Response has `plan_id` / `trial` → Subscription abuse
│  └─ Confirmed → sibling: cancel→reactivate cycle, plan downgrade
├─ Balance/credits in response → Wallet race condition
│  └─ Confirmed → sibling: transfer endpoint, check ledger atomicity
├─ Coupon field accepted → Coupon abuse
│  └─ Confirmed → sibling: stackable coupons, negative quantity, expiry bypass
├─ Role/permission field → Mass assignment → Role escalation
│  └─ Confirmed → sibling: admin endpoints, user management APIs
├─ OTP/verification step visible → OTP bypass
│  └─ Confirmed → sibling: email change in same flow, password reset
├─ Multi-step checkout → Workflow bypass
│  └─ Confirmed → sibling: state machine endpoints, admin approval flows
├─ Refund/cancel buttons → Refund abuse
│  └─ Confirmed → sibling: partial refund, cancel+order new, race cancel
├─ Org/workspace IDs → Cross-tenant access
│  └─ Confirmed → sibling: ALL endpoints with org param, invite flow
├─ Sequential/guessable IDs → IDOR
│  └─ Confirmed → sibling: PUT/DELETE on same ID pattern, nested resources
└─ Unknown → Log all responses, compare diff user A vs B → find any diff

TOOL CHAIN

Session A: curl -H "Cookie: SESSION_A" [endpoint]
Session B: curl -H "Cookie: SESSION_B" [endpoint]
Compare: diff <(curl_A) <(curl_B)
Race: for i in {1..N}; do curl ... &; done; wait
Fuzz IDs: for i in {1..N}; do curl /api/resource/$i; done

FALSE POSITIVE KILLS

  • 401/403 = auth present (move on)
  • DB UNIQUE violation = no race
  • Same data both sessions = no IDOR
  • Coupon already redeemed = one-time lock
  • "Cannot skip step" = state machine present

PATTERN FILES

PatternFile
IDOR Deep Divereference/advanced-idor.md
Chain Constructionreference/chain-construction.md
Coupon/Discountreference/coupon-discount-abuse.md
Cross-Tenantreference/cross-tenant-access.md
Email Change Abusereference/email-change-abuse.md
Flow Mappingreference/flow-mapping.md
5 Questions Frameworkreference/framework-5-questions.md
Mass Assignmentreference/mass-assignment.md
Multi-Account Setupreference/multi-account-infrastructure.md
OTP/MFA Bypassreference/otp-mfa-bypass.md
Pattern Templatereference/pattern-template.md
Prerequisite Modelreference/prerequisite-model.md
Privilege Escalationreference/privilege-escalation.md
Race Conditionsreference/race-conditions.md
Refund Abusereference/refund-abuse.md
Subscription Abusereference/subscription-abuse.md
Toolingreference/tooling.md
Verificationreference/verification.md
Wallet Manipulationreference/wallet-balance-manipulation.md
Workflow Bypassreference/workflow-bypass.md

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.