A workflow is a story with invariants: a price cannot go negative, a coupon is used once, a refund cannot exceed a payment. The attacker changes the story, not the syntax.
The server trusts a client-supplied price, quantity, currency or status. It checks each step in isolation but not the sequence or the final invariant. Negative values, replay and skipped steps turn a valid workflow into a loss.
- Inspect the checkout request
- Change the trusted value
- Complete the order and capture the flag
Client price to server price
Where to look before you type a payload
List states, allowed transitions, actors and invariants. A business rule is a property of the system, not a field validator.
Receive quantities, prices, coupons and identifiers, but treat every client value as a proposal.
Derive prices, totals, eligibility and limits on the server from trusted data.
Check and consume one-time resources in a transaction so concurrent requests cannot both win.
Open one hint at a time. The first two build the model; the last two point at the boundary.
Hint 1
Map the checkout or workflow and every client-controlled value.
Hint 2
Try negative, zero or oversized values.
Hint 3
The server trusts a client-controlled value. Try a negative, zero or replayed value in the currency-confusion flow.
Hint 4 · near the answer
Break the business invariant and capture the flag.
Observe → Hypothesize → Test → Prove → Explain
This is the same loop a reviewer expects in a report. Your draft stays in this browser; nothing is submitted until you choose to export it.
Evidence log
Write for a reviewer who was not in the room. Every claim needs a request, response or state change behind it.
Preview the evidence report
# Lab evidence report — Cents and Dollars - Family: Business Logic - Lab ID: web-logic-currency-confusion - Date: 2026-12-05 ## Workflow ### Observe - [ ] Open "Cents and Dollars" and record the entry point, the HTTP method and the role you are given. - [ ] List every parameter, header, cookie and object identifier the normal flow exposes. - [ ] Save a baseline response: status, body shape, timing and the fields that change by user. ### Hypothesize - [ ] Name the server decision that protects the entry point, and the evidence it should use. - [ ] Use the clue as a constraint, not an answer: The server accepts a value the client should never control. Try a negative or zero amount. - [ ] Predict the exact status, body or state change that would prove the decision is missing. ### Test - [ ] Start from the baseline and change one value: the currency-confusion workflow values. - [ ] Keep the request replayable; vary encoding, method or identifier location only after the first result. - [ ] Capture the full request and response for the winning attempt, including the flag. ### Prove - [ ] Capture the flag and name the exact foreign object, role or state change it proves. - [ ] Repeat from a clean session and confirm the result is not cached or stale. - [ ] State impact precisely: what data or action did you actually obtain? ### Explain - [ ] State the root cause without naming the payload: which decision failed? - [ ] Name the control that prevents recurrence and the layer where it belongs. - [ ] Write one regression test that fails before the fix and passes after it. ## Evidence ### Target and baseline _Not recorded._ ### Hypothesis _Not recorded._ ### Winning request _Not recorded._ ### Proof _Not recorded._ ### Root cause _Not recorded._ ### Control and regression test _Not recorded._ ## Analyst conclusion The proof demonstrates the missing control above. The regression test should fail against the vulnerable behavior and pass after remediation.
The full request, the reasoning and the debrief unlock after a successful capture. That is deliberate: struggle first, then consolidate.
False positives to rule out
- The form rejects negative numbers: test the API directly and try zero, fractional, very large and replayed values.
- The total looks correct in the UI: the server may trust a hidden price or discount field.
- The coupon fails on the second attempt: test two parallel attempts, not two sequential ones.
Regression tests to name
- Negative value: The server rejects the request or recomputes a valid non-negative total
- Parallel redemption: Exactly one succeeds and the other receives a deterministic failure
- Currency and rounding: The server normalizes to minor units and rejects mismatches
- Enforce invariants server-side at the final commit.
- Use state machines, idempotency keys and explicit limits.
- Recompute prices and permissions from trusted data, never from the client.
بعض الثغرات ليست في الكود، بل في منطق العمل نفسه.