Skip to content
Back to skills

State Machine Abuse

ASecurity

Checkout, auth and redemption flows: step skipping, replay, races

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
developmentrust

Works with

  • cli

Security analysis

A100/100

Scanned November 29, 2026

npx -y skills add blackfoxxx/kestrel --skill state-machine-abuse --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of State Machine Abuse?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for State Machine Abuse
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/blackfoxxx-state-machine-abuse/badge)](https://www.skillsdirectory.com/skills/blackfoxxx-state-machine-abuse)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: state-machine-abuse
description: "Checkout, auth and redemption flows: step skipping, replay, races"
---

# State-machine abuse (flows, replay and races)

Most high-impact web bugs are not injections; they are a flow that can be walked
in a way the designer did not intend. A checkout that trusts a client price, a
verification step that can be skipped, a coupon that can be redeemed twice under
concurrency — each is a business-logic bug with direct monetary impact.

Authorized engagements only. Use the smallest value that proves the point.

## 1. Map the flow from real traffic

For each money or privilege flow, write the states and transitions:

```
register → verify email → login → add to cart → checkout
        → apply coupon → pay → fulfill → refund
payout: request → approve → paid
auth:   login → step-up (OTP) → session elevated
```

For every transition, record: the request, the server-side guard, and the state
it produces. Use `traffic_search` to find the real requests instead of guessing
endpoint names.

## 2. The five failure modes

| Failure | Test |
|---|---|
| **Step skipping** | Call the later transition directly (fulfill/approve/payout) without the earlier one; does the server re-check the prerequisite? |
| **Out-of-order** | Apply a coupon after payment; refund before fulfillment; verify after login. |
| **Replay** | Resend a one-time token, OTP, reset link, or signed callback. Does it stay single-use? |
| **Client-trusted values** | Change price, quantity, currency, discount, role, user id in the request. Does the server re-derive them? |
| **Concurrency** | Fire the same single-use request in parallel (`race_burst`). Does it succeed more than once? |

## 3. Confirming a race

1. Pick one single-use operation with a small value (one coupon, minimum credit).
2. Read the state before (balance, coupon count, order status).
3. Run `race_burst` with a modest count (20). More than one distinct outcome is a
   candidate.
4. Read the state after. If the value moved twice, that is the finding.
5. Confirm once more with a second burst, then stop. Do not repeat on a live
   balance after the proof.

## 4. Confirming a logic bypass

A price/quantity/role tamper is confirmed only when the **server-side result**
changes: the order total, the granted role, the credited balance. A request that
returns 200 but stores the original value is not a finding.

## 5. Impact statement

State it in money or access terms: "an authenticated user can obtain a €50 gift
card for €0.01", "a standard user can approve their own payout", "the same coupon
can be redeemed N times". Vague "business logic flaw" is not a finding.

## 6. Boundaries

- Never move real funds beyond the minimum proof; if the engagement has a test
  account, use it.
- If a proof changes production state, record exactly what changed and revert if
  the application allows it.
- A flow that is merely unusual is not a finding. It needs a crossed boundary or
  a value that should not have changed.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.