Business logic testing

From xalgorix/xalgorix · View interactive version

Business logic testing is an AI agent skill from the GitHub repository xalgorix/xalgorix. Discover the application intended business rules and violate their assumptions - money and value manipulation, limit bypass, identity and relationship abuse, state misuse - proving persisted out-of-policy outcomes rather than status-code blips.

How to use this skill

Skill file

Business Logic Testing

Purpose

Business logic flaws are rules the application MEANT to enforce but does not: prices, quantities, limits, coupons, quotas, identities, and states. Scanners cannot find them because the bug is not in a payload pattern - it is in the gap between intended rule and enforced rule. This skill teaches how to discover the intended rules black-box, then violate one assumption at a time and verify the backend actually persisted the out-of-policy outcome.

Entry Conditions

Step 1: Discover the Intended Rules

Black-box rule discovery from: UI copy ("one per customer", "limit 3", "non-refundable"), error messages on first violation (the app tells you the rule it thinks it enforces), pricing pages and ToS, how a legit transaction progresses (which fields are client-supplied vs recomputed), and client-side validation code (what the frontend refuses reveals what the backend SHOULD check).

Record each discovered rule as: rule, where observed, and the request that would violate it.

Step 2: Establish a Legitimate Baseline

Perform the transaction normally once - capture every request. The baseline tells you which parameters the client controls, what a normal response looks like, and what state changed. Never report a manipulation without having observed the legitimate behavior of the same flow.

Step 3: Identify Attacker-Controlled Variables

For each request in the flow: which values does the server accept from you? Price, total, quantity, discount, currency, role, plan, ids, coupon, timestamps, state? Any value that should be server-derived but appears client-supplied is a primary target.

Violation Catalog

Money and value

Limits

Identity and business relationships

State misuse

Methodology

understand intended rule (from UI/errors/behavior)
-> establish legitimate baseline (captured)
-> identify attacker-controlled variables
-> violate ONE invariant at a time
-> observe backend state (re-fetch the object - do not trust the response alone)
-> verify persistent business outcome
-> report with rule violated + baseline + tampered request + resulting state

Violate one variable at a time: if quantity AND price are both tampered, you cannot attribute the outcome.

Evidence Contract

Not enough: POST /coupon returned 200 twice.

Good proof: the same single-use coupon produced two persisted discounts/orders - re-fetch the cart/orders and show both entries, or show the coupon redemption counter incremented twice.

Not enough: checkout accepted total 0.01.

Good proof: an order exists in the order history with total 0.01 and a real product attached (server persisted the out-of-policy outcome).

Not enough: negative quantity got a 200.

Good proof: balance/credit reflects the negative-side effect (credit issued, inventory incremented, refund created).

Always verify by re-reading state server-side (order history, balance, quota counter) - never report from the immediate response alone.

Common Misses

False Positives

Xalgorix Tool Strategy

When to Load a Specialist Skill

Stopping Rule

Stop broad mutation when: every discovered business rule has had its primary invariant violated once, all money/limit/identity/state categories are represented in tested rules, and no new rule appears from two consecutive legitimate flow walks. Then go deep on the rules that broke (persist proof, chain with other primitives) instead of mutating every remaining permutation.

Handoffs

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.