Issue
A race condition occurs when operations whose execution overlaps use the same state and their timing or order changes the result. In a web application, a common pattern is a time-of-check to time-of-use (TOCTOU) flaw: the server checks a rule, such as whether a coupon is unused, and updates the state later. Two requests may both read the old state before either update is saved.
Races can also occur across several steps or endpoints, without a single obvious check-then-update pair. Common causes include separate reads and writes that are not protected together, missing or incorrectly scoped locks, checks that are not enforced by the data store, and retries that repeat a state change. An atomic operation is treated as one indivisible step relative to competing operations. A multi-step transaction also needs isolation rules that prevent invalid interleavings. OWASP’s Business Logic Security Cheat Sheet describes check-then-act operations as potential race conditions; CWE-362 covers concurrent access to shared resources without proper synchronization.
A security issue requires concurrent actions to affect the same relevant state, a rule the application is supposed to enforce, and a path where the server or authoritative data store fails to preserve that rule. Requests need not come from different users. Sending requests close together does not prove the server processed them concurrently.
Impact
The consequence depends on the rule and operation involved. A confirmed flaw may allow a limit to be exceeded, a one-time benefit to be applied twice, a balance to become inconsistent, or a workflow to reach an unintended state. Claims such as account takeover require separate evidence that the race gives an unauthorized party control of an account.
Duplicate-looking responses, a timeout, or a changed status code alone do not prove a harmful state change.
Testing
Use authorized staging systems and resettable synthetic data. Establish a sequential baseline, send the smallest useful concurrent burst, and verify the authoritative final state after asynchronous work settles. Stop if stability is affected. Run each case only when its feature and architecture exist.
Concurrent debit, transfer, withdrawal, or stored-value spend
Applicability
Broadly applicable to endpoints that debit a balance, transfer funds or credits, withdraw value, spend a gift-card balance, or consume loyalty points. Omit it when the application has no server-side balance or stored-value operation. Use only a sandbox ledger or synthetic balance; do not involve a real payment rail.
Objective
Determine whether two concurrent debits against the same source can both commit when their combined amount exceeds the available synthetic balance.
Security rule
The balance check and debit must be one atomic operation. Committed debits must never exceed the available balance or produce a negative balance unless an explicitly documented overdraft policy permits it.
Controlled setup
Create test account race-user-01 with synthetic wallet WALLET-RACE-01 and an exact balance of 100.00 TEST. Prepare two resettable destination wallets. Use one test session, a reversible internal transfer of 60.00 TEST, and ledger marker race-debit-2026-01.
Steps
- Record the starting balance and ledger, then send the baseline request once. Confirm one
60.00 TESTdebit and a final balance of40.00 TEST. - Reset the source to
100.00 TESTand remove the baseline ledger entry using the approved fixture or administrative reset. - Warm the authenticated connection with a harmless account request if needed. Send two byte-identical transfer requests concurrently over the same supported protocol, using a modest synchronization method approved for the environment.
- Wait for all synchronous and queued processing to finish. Inspect the authoritative source balance, both destination balances, and the transaction ledger.
- Repeat only a few times with a full reset between trials. Stop if a real integration is reached or the ledger cannot be safely restored.
Baseline request
POST /api/test-wallets/WALLET-RACE-01/transfers HTTP/1.1
Host: payments.example.test
Authorization: Bearer TEST_RACE_USER_TOKEN
Content-Type: application/json
X-Test-Marker: race-debit-2026-01
{"destinationWallet":"WALLET-RACE-DEST","amount":"60.00","currency":"TEST"}
Baseline result: One transfer commits, exactly one 60.00 TEST debit appears in the ledger, and the source balance becomes 40.00 TEST.
Test request
Send two copies of the following request concurrently:
POST /api/test-wallets/WALLET-RACE-01/transfers HTTP/1.1
Host: payments.example.test
Authorization: Bearer TEST_RACE_USER_TOKEN
Content-Type: application/json
X-Test-Marker: race-debit-2026-01
{"destinationWallet":"WALLET-RACE-DEST","amount":"60.00","currency":"TEST"}
Changed value: delivery pattern one request → two concurrent copies of the same request.
Values kept the same: Credentials, method, endpoint, source wallet, destination wallet, amount, currency, headers, marker, and body remain unchanged. Reset state is identical before the baseline and concurrent trial.
Expected secure result
At most one debit commits. The other request is rejected, rolled back, or serialized and then rejected for insufficient funds. The authoritative source balance remains 40.00 TEST, and the ledger contains one committed transfer.
Evidence confirming a finding
Two committed debits, two credited destinations, a negative or otherwise policy-invalid source balance, or a ledger whose committed debit total exceeds 100.00 TEST confirms the race. Two 2xx responses alone do not.
Evidence to preserve
Sanitized baseline and concurrent request/response pairs; test account and wallet identifiers; starting and ending balances; ledger rows with marker, operation IDs, and timestamps; trial count; protocol and synchronization method; correlation IDs; and proof that no overdraft policy applied.
Likely false positives
An allowed overdraft or credit line, pending entries later rolled back, display-layer staleness, duplicate success responses referring to one transaction ID, eventual consistency, or a test reset that did not restore the exact starting balance.
References
- OWASP WSTG: Payment Functionality — Race Conditions
- OWASP WSTG: Business Logic Data Validation (WSTG-BUSL-01)
- OWASP Business Logic Security Cheat Sheet: Prevent Race Conditions on Sensitive Operations
- OWASP Transaction Authorization Cheat Sheet
Concurrent use of a one-time token, coupon, credit, or reward
Applicability
Broadly applicable when the application has a single-use or limited-use coupon, gift card, referral reward, invitation, password-reset token, email-verification token, recovery code, or similar consumable. Omit it if no such feature exists. Prefer a harmless coupon or invitation in staging; test authentication-recovery tokens only with dedicated accounts and explicit authorization.
Objective
Determine whether the same one-time value can be consumed more than once by concurrent identical requests.
Security rule
Checking eligibility, applying the benefit or state change, and recording consumption must be atomic. One-time means at most one committed use across all workers and instances.
Controlled setup
Create test account race-user-02, synthetic order ORDER-RACE-02, and coupon RACE-ONCE-02, configured for one use and a harmless 5.00 TEST discount. Put marker race-once-2026-02 in the order notes. Record the unused coupon state and undiscounted order total.
Steps
- Apply the coupon once to the synthetic order and verify one redemption record and one
5.00 TESTdiscount. - Reset the coupon and order to their exact unused and undiscounted states.
- Send two identical apply-coupon requests concurrently with the same account and order.
- After processing settles, inspect the coupon redemption record, order calculation, benefit ledger, and any downstream credit.
- If the design limits use per account and globally, evaluate each documented invariant separately with its own fixture; do not combine them into one conclusion.
Baseline request
POST /api/test-orders/ORDER-RACE-02/coupons HTTP/1.1
Host: shop.example.test
Authorization: Bearer TEST_RACE_USER_TOKEN
Content-Type: application/json
X-Test-Marker: race-once-2026-02
{"couponCode":"RACE-ONCE-02"}
Baseline result: The order receives one 5.00 TEST discount and the coupon has exactly one redemption record.
Test request
Send two copies of the following request concurrently:
POST /api/test-orders/ORDER-RACE-02/coupons HTTP/1.1
Host: shop.example.test
Authorization: Bearer TEST_RACE_USER_TOKEN
Content-Type: application/json
X-Test-Marker: race-once-2026-02
{"couponCode":"RACE-ONCE-02"}
Changed value: delivery pattern one request → two concurrent copies of the same request.
Values kept the same: Credentials, method, endpoint, order, coupon code, headers, marker, and body remain unchanged; the fixture begins unused in both trials.
Expected secure result
Exactly one request may consume the coupon and apply the discount. Every other concurrent attempt is rejected or resolves to the already-recorded result without adding value. Final state shows one redemption and one discount.
Evidence confirming a finding
More than one redemption row, a discount or credit applied more than once, the same token producing state changes on multiple synthetic objects when policy permits only one, or another unauthorized final-state change proves the issue. Multiple success responses that all reference one redemption do not.
Evidence to preserve
Sanitized requests and responses; coupon configuration and scope; pre-test unused state; order totals before and after; redemption and benefit-ledger records; operation and correlation IDs; account role; timestamps; and reset procedure.
Likely false positives
An intentionally reusable promotion, one redemption exposed through duplicate representations, retries returning the original result, queued records later deduplicated, a coupon scoped per order rather than globally, or an incorrect assumption about the documented use limit.
References
- OWASP WSTG: Payment Functionality — One-Time-Use Tokens
- OWASP WSTG: Testing for the Circumvention of Work Flows (WSTG-BUSL-06)
- OWASP Business Logic Security Cheat Sheet: Identify the Critical Sections
Concurrent allocation of the last scarce resource
Applicability
Broadly applicable to inventory, seats, appointments, registrations, licenses, reservations, or any capacity-limited resource. Omit it when the application does not allocate scarce resources. Use a synthetic capacity pool that no real customer can see or reserve.
Objective
Determine whether concurrent requests can allocate more units than the authoritative remaining capacity.
Security rule
Availability checking and allocation must be atomic. Confirmed allocations must not exceed capacity, and a reservation must not silently become confirmed after capacity has been consumed.
Controlled setup
Create private test event EVENT-RACE-03 with exactly one remaining seat SEAT-RACE-03. Create test account race-user-03 and ensure the reservation is reversible. Add marker race-capacity-2026-03. If the endpoint requires a quantity, use 1 in all requests.
Steps
- Reserve the single seat once and verify one confirmed allocation and zero remaining capacity.
- Cancel the reservation through the approved test workflow and confirm the seat is available again.
- From the same account, send two identical reservation requests concurrently. Keeping one identity isolates capacity enforcement from cross-user authorization.
- Wait for holds, queues, and confirmation jobs to settle, then inspect the allocation table, capacity counter, and user-visible bookings.
- Clean up any successful reservation. If testing two-user contention is separately required, treat identity as the variable in a separate test rather than mixing it into this comparison.
Baseline request
POST /api/test-events/EVENT-RACE-03/reservations HTTP/1.1
Host: booking.example.test
Authorization: Bearer TEST_RACE_USER_TOKEN
Content-Type: application/json
X-Test-Marker: race-capacity-2026-03
{"seatId":"SEAT-RACE-03","quantity":1}
Baseline result: One confirmed reservation exists for SEAT-RACE-03, and authoritative remaining capacity is zero.
Test request
Send two copies of the following request concurrently:
POST /api/test-events/EVENT-RACE-03/reservations HTTP/1.1
Host: booking.example.test
Authorization: Bearer TEST_RACE_USER_TOKEN
Content-Type: application/json
X-Test-Marker: race-capacity-2026-03
{"seatId":"SEAT-RACE-03","quantity":1}
Changed value: delivery pattern one request → two concurrent copies of the same request.
Values kept the same: Credentials, method, endpoint, event, seat, quantity, headers, marker, and body remain unchanged; starting capacity is one in both trials.
Expected secure result
At most one confirmed allocation exists. The competing request is rejected, waits and then fails, or returns the same reservation without creating another. Capacity never becomes negative or inconsistent.
Evidence confirming a finding
Two distinct confirmed reservation IDs for the one seat, confirmed allocation count greater than configured capacity, negative remaining capacity, or two downstream fulfillment records confirms the race.
Evidence to preserve
Capacity configuration; sanitized request/response pairs; reservation IDs and statuses; before-and-after capacity; allocation-table or administrative-view evidence; account and marker; timestamps and correlation IDs; and proof that temporary holds had expired or settled.
Likely false positives
Temporary holds rather than confirmations, general-admission inventory that intentionally overbooks, duplicate views of one reservation, later reconciliation that cancels one unfulfilled hold, stale capacity displays, or an undocumented capacity pool larger than the tested seat.
References
- OWASP WSTG: Payment Functionality — Race Conditions and Resource Allocation
- OWASP WSTG: Test for Process Timing (WSTG-BUSL-04)
- OWASP Business Logic Security Cheat Sheet: Prevent Race Conditions on Sensitive Operations
Concurrent overrun of a per-account quota or attempt limit
Applicability
Broadly applicable to creation quotas, voting or rating limits, claim limits, API-key limits, invitation limits, and authentication controls such as MFA attempt counters. Omit it when no server-enforced count or threshold exists. Prefer a harmless resource quota; test login, reset, or MFA attempt limits only with dedicated accounts and explicit approval because lockouts can disrupt access.
Objective
Determine whether a concurrent burst can commit more actions than the documented remaining allowance.
Security rule
The limit check and counter/resource update must be atomic. The number of committed actions and the authoritative counter must agree and must not exceed the configured limit.
Controlled setup
Configure race-user-04 for a maximum of three private test projects and create two projects, leaving an allowance of one. Use synthetic project name race-quota-2026-04; ensure projects are deletable. Record the authoritative project count and quota counter.
Steps
- Create one project with the baseline request and confirm the account reaches exactly three projects.
- Delete the baseline project and confirm the account returns to two projects with one remaining allowance.
- Send two identical create requests concurrently. If the API requires unique names, use an endpoint-supported client request ID that safely returns one object for repeats; do not change the name between copies.
- Wait for asynchronous creation and quota accounting, then count committed projects and inspect the quota counter.
- Delete created fixtures. Test a different kind of limit as a separate case with its own documented threshold.
Baseline request
POST /api/test-projects HTTP/1.1
Host: app.example.test
Authorization: Bearer TEST_RACE_USER_TOKEN
Content-Type: application/json
X-Test-Marker: race-quota-2026-04
{"name":"race-quota-2026-04","visibility":"private"}
Baseline result: Exactly one project is created, the account has three projects, and its remaining allowance is zero.
Test request
Send two copies of the following request concurrently:
POST /api/test-projects HTTP/1.1
Host: app.example.test
Authorization: Bearer TEST_RACE_USER_TOKEN
Content-Type: application/json
X-Test-Marker: race-quota-2026-04
{"name":"race-quota-2026-04","visibility":"private"}
Changed value: delivery pattern one request → two concurrent copies of the same request.
Values kept the same: Credentials, method, endpoint, project fields, headers, marker, and body remain unchanged; the account begins with two of three permitted projects in both trials.
Expected secure result
At most one new project commits. The account finishes at three projects, the counter agrees with stored objects, and the competing request is rejected or resolves to the same object without consuming another quota unit.
Evidence confirming a finding
Two distinct committed projects when only one allowance remained, an authoritative count above three, or a quota counter lower than the number of successful creations confirms the issue. A burst producing errors without an overrun is not a confirmed vulnerability.
Evidence to preserve
Documented quota; sanitized requests and responses; account role and identifier; project IDs and marker; before-and-after object list and counter; timestamps; operation IDs; burst size; and cleanup result.
Likely false positives
Soft or advisory quotas, administrator-granted exceptions, duplicate list entries for one object, delayed counter reconciliation with no usable extra resource, eventual deletion of a failed object, or confusing per-workspace and per-user limits.
References
- OWASP WSTG: Payment Functionality — Limit Overrun
- OWASP WSTG: Test Number of Times a Function Can Be Used Limits (WSTG-BUSL-05)
- OWASP Business Logic Security Cheat Sheet: Protect Abuse-friendly Features
Concurrent retry of a non-idempotent external or asynchronous action
Applicability
Applicable only when an endpoint triggers a payment-provider call, refund, payout, email, webhook, job, entitlement grant, or other side effect that clients or intermediaries may retry. Omit it for read-only or naturally idempotent operations. Use a provider sandbox, captured email sink, or fake downstream service.
Objective
Determine whether two concurrent retries bearing the same idempotency key start or commit the protected side effect more than once.
Security rule
The idempotency key must be scoped to the authenticated caller and operation, bound to the original parameters, and claimed atomically so only one execution starts. Replays may return the stored result but must not repeat the side effect.
Controlled setup
Create synthetic refund REFUND-RACE-05 for 10.00 TEST against a sandbox payment. Use account race-user-05, idempotency key race-refund-2026-05, and a fake provider that records calls without moving money. Ensure the refund and provider log can be reset.
Steps
- Send the baseline request once. Confirm one local refund record and one provider call for
10.00 TEST. - Reset both the application record and fake-provider log to the pre-refund state.
- Send two identical requests concurrently with the same idempotency key and body.
- Wait for retries and queues to settle. Inspect the local operation table, provider call log, refund state, and returned operation IDs.
- Preserve the result before cleanup. Parameter-mismatch behavior is a separate test because changing the request body would introduce another variable.
Baseline request
POST /api/test-payments/PAYMENT-RACE-05/refunds HTTP/1.1
Host: payments.example.test
Authorization: Bearer TEST_RACE_USER_TOKEN
Idempotency-Key: race-refund-2026-05
Content-Type: application/json
X-Test-Marker: race-refund-2026-05
{"amount":"10.00","currency":"TEST","reason":"authorized-race-test"}
Baseline result: One refund operation commits and the fake provider records exactly one call.
Test request
Send two copies of the following request concurrently:
POST /api/test-payments/PAYMENT-RACE-05/refunds HTTP/1.1
Host: payments.example.test
Authorization: Bearer TEST_RACE_USER_TOKEN
Idempotency-Key: race-refund-2026-05
Content-Type: application/json
X-Test-Marker: race-refund-2026-05
{"amount":"10.00","currency":"TEST","reason":"authorized-race-test"}
Changed value: delivery pattern one request → two concurrent copies of the same request.
Values kept the same: Credentials, method, endpoint, payment, idempotency key, headers, amount, currency, reason, marker, and body remain unchanged.
Expected secure result
Only one execution reaches the provider and only one refund commits. Both callers may receive the same stored operation result, or one may receive an in-progress response, but no duplicate downstream effect occurs.
Evidence confirming a finding
Two provider calls, two distinct committed refund or job IDs, two delivered side effects, or a doubled sandbox balance change proves the issue. Two response bodies or two local retry log entries that map to one provider operation do not.
Evidence to preserve
Sanitized requests and responses; caller identity; idempotency key; local operation rows; fake-provider request log and provider operation IDs; queue/job IDs; timestamps and correlation IDs; final sandbox state; and retention-window configuration relevant to the trial.
Likely false positives
At-least-once queue delivery followed by downstream deduplication, duplicate local attempt logs for one effect, provider webhooks reporting the same operation twice, test instrumentation counting retries rather than commits, or reuse after the documented idempotency retention period.
References
- OWASP WSTG: Payment Functionality — Race Conditions
- OWASP WSTG: Testing for the Circumvention of Work Flows (WSTG-BUSL-06)
- OWASP Business Logic Security Cheat Sheet: Use Idempotency Keys for External Actions
Conflicting concurrent workflow transitions
Applicability
Conditional: include only when the same object can receive competing state-changing actions, such as approve versus cancel, confirm versus expire, publish versus delete, or fulfill versus refund. Omit it when the application has no multi-step state machine or mutually exclusive transitions. Use reversible synthetic workflow objects.
Objective
Determine whether one authorized transition can commit after a competing transition has made its precondition false.
Security rule
Each transition must atomically verify the current authoritative state and permitted transition. The object must end in one valid state with only the side effects allowed for that state.
Controlled setup
Create synthetic request REQUEST-RACE-06 in pending state. Use one test operator authorized to approve and cancel test requests, so identity and authorization remain constant. Add marker race-state-2026-06. Configure approval to grant a harmless test entitlement and cancellation to grant none.
Steps
- Send the approval baseline from a fresh
pendingobject and confirm stateapprovedplus one test entitlement. - Reset the object to a new, equivalent
pendingfixture. - Establish that cancellation also works normally on a separate equivalent fixture; this is a control, not the comparison request.
- Send approval and cancellation concurrently against
REQUEST-RACE-06, with the same credentials and headers. The single changed security-relevant value between the two competing requests is the action pathapproveversuscancel. - After all jobs settle, inspect state history, current state, entitlement records, notifications, and downstream jobs. Repeat with reset fixtures only if needed.
Baseline request
POST /api/test-requests/REQUEST-RACE-06/approve HTTP/1.1
Host: workflow.example.test
Authorization: Bearer TEST_OPERATOR_TOKEN
Content-Type: application/json
X-Test-Marker: race-state-2026-06
{"comment":"authorized race test"}
Baseline result: From pending, the request becomes approved and exactly one harmless test entitlement is granted.
Test request
Send the baseline approval request concurrently with this competing request:
POST /api/test-requests/REQUEST-RACE-06/cancel HTTP/1.1
Host: workflow.example.test
Authorization: Bearer TEST_OPERATOR_TOKEN
Content-Type: application/json
X-Test-Marker: race-state-2026-06
{"comment":"authorized race test"}
Changed value: action path /approve → /cancel in the competing request.
Values kept the same: Credentials, method, host, object ID, headers, marker, comment, and body remain unchanged. Both requests begin against the same pending fixture.
Expected secure result
Only one transition commits. The losing transition rechecks state and fails or becomes a documented no-op. The final state, history, entitlement, notifications, and downstream work all agree with the winning transition.
Evidence confirming a finding
A final cancelled object retaining an approval entitlement, both transitions recorded as committed when mutually exclusive, duplicate fulfillment and cancellation effects, or another state/history combination forbidden by the documented state machine confirms the issue.
Evidence to preserve
State-machine rule or product requirement; sanitized requests and responses; operator role; object ownership and initial state; complete state history; before-and-after entitlement and job records; timestamps and correlation IDs; and cleanup or rollback evidence.
Likely false positives
A documented compensating transition, an audit log that records attempted rather than committed transitions, notification delivery after a valid rollback, temporary intermediate states, eventual consistency, or a product rule that permits cancellation after approval and correctly revokes the entitlement.
References
- OWASP WSTG: Testing for the Circumvention of Work Flows (WSTG-BUSL-06)
- OWASP WSTG: Test for Process Timing (WSTG-BUSL-04)
- OWASP Business Logic Security Cheat Sheet: Enforce Workflows as Explicit State Machines
Exposure or use of a partially constructed object
Applicability
Conditional: include only when object creation spans multiple database operations, services, jobs, or requests and another endpoint can read or use the object before initialization completes. Examples include account creation followed by token generation, order creation followed by ownership assignment, or resource creation followed by policy attachment. Omit it for atomic creation with no externally reachable intermediate state.
Objective
Determine whether a concurrent read or use request can observe or act on a new object before security-critical defaults, ownership, token, or policy fields are initialized.
Security rule
An object must not become externally readable or usable until all security-critical fields and relationships are valid. Empty, null, or default values must fail closed and must not act as wildcards or valid credentials.
Controlled setup
Create test account race-user-07 and a resettable registration flow that produces account ACCOUNT-RACE-07. Use marker race-partial-2026-07. Arrange for the normal test harness to reveal the generated account ID without using real personal data. The account must have no privileges beyond the isolated fixture.
Steps
- Complete registration normally. After completion, send the baseline profile request with the issued test API key and confirm the initialized account marker is returned.
- Remove the synthetic account and verify the identifier and marker no longer resolve.
- Start the same registration request and, concurrently, poll the documented profile endpoint using the new test account identifier and an empty API-key value. Keep the use request identical across attempts.
- Repeat a small number of times only if the construction window is nondeterministic. Do not add server load to widen the window unless separately authorized.
- Inspect the account record, initialization job, access logs, and any response content. Confirm whether any access occurred before the account reached
activewith its real key and ownership policy.
Baseline request
After normal creation completes, prove the endpoint works with the issued synthetic key:
GET /api/test-accounts/ACCOUNT-RACE-07/profile HTTP/1.1
Host: identity.example.test
Authorization: ApiKey TEST_ISSUED_KEY_07
X-Test-Marker: race-partial-2026-07
Baseline result: The completed account is active, the issued key authenticates, and the response contains harmless marker race-partial-2026-07.
Test request
Race normal account creation against this otherwise fixed use request:
GET /api/test-accounts/ACCOUNT-RACE-07/profile HTTP/1.1
Host: identity.example.test
Authorization: ApiKey
X-Test-Marker: race-partial-2026-07
Changed value: API-key value TEST_ISSUED_KEY_07 → empty value while the object is being constructed.
Values kept the same: Test account identifier, method, endpoint, host, marker, and all other headers remain unchanged. The creation request itself is the same legitimate registration request used to establish the completed object.
Expected secure result
Before initialization completes, the use request returns no protected profile data and triggers no action. After completion, only the issued key works. Empty or null credentials never match an uninitialized field.
Evidence confirming a finding
Protected marker content returned to the empty-key request, an authenticated session or entitlement created before initialization, an unauthorized action accepted, or logs showing the request was authorized against an empty/default security field confirms the issue. Merely learning that an object ID exists does not prove this finding unless existence itself is protected by policy.
Evidence to preserve
Sanitized creation, baseline, and concurrent use requests/responses; exact initial and final object states; harmless marker; initialization and access-log timestamps; account role and ownership; job and correlation IDs; successful trial count; and proof the empty key had no legitimate meaning.
Likely false positives
A deliberately public pre-activation record, a health or status endpoint returning only non-protected data, a proxy-generated response, identifier enumeration without protected content, cached content from a prior fixture, or a response arriving after initialization actually completed.
References
- OWASP WSTG: Payment Functionality — Partial Construction
- OWASP WSTG: Testing for the Circumvention of Work Flows (WSTG-BUSL-06)
- OWASP Business Logic Security Cheat Sheet: Threat Model from the Business Process
Mitigation
Primary fix: Enforce the rule atomically at the authoritative data layer. Depending on the design, use a transaction with suitable isolation, a conditional update that succeeds only from the expected prior state, a unique constraint for one-time redemption, or a lock that covers the complete critical section. For example, change a coupon from unused to redeemed only if it is still unused, and apply the discount in the same transaction.
An application mutex alone may not protect a multi-process or multi-server deployment. Use idempotency keys for operations that clients or intermediaries may retry, and bind each key to the authenticated principal and operation. Idempotency helps prevent duplicate retries, but does not replace enforcement of the business rule. Keep related endpoints and background workers on the same enforcement path.
Retest with reset test data. Verify the committed order, coupon record, balance or ledger, and any asynchronous result. Confirm that only the allowed state transition occurs, retries with the same idempotency key do not duplicate effects, and independent valid requests still work. Where possible, add a regression test that checks the rule under concurrent execution.