Temporary hold on time slot
Why it matters
In multi-step booking flows, the gap between slot selection and payment completion can span several minutes of form-filling. Without a temporary hold during that window, a second user can select the same slot, complete the flow first, and the original user hits a conflict error at the payment step — after they've already entered card details. CWE-362 describes this as a classic TOCTOU (time-of-check to time-of-use) window. The user experience failure is severe: you've collected full intent and payment details from a customer only to tell them at the last step that the slot is gone.
Severity rationale
Low because the primary impact is user experience degradation (failed checkout at the final step) rather than data corruption or security exposure.
Remediation
Implement a Redis key with a TTL or a database row with status='HELD' and an expiresAt timestamp when the user selects a slot. Add this in your slot-selection handler (e.g., src/app/api/bookings/hold/route.ts).
// Redis-based hold — 5-minute TTL, no-overwrite (NX)
await redis.set(`booking:hold:${slotId}:${userId}`, '1', 'NX', 'EX', 300);
// Or: database hold record
await db.bookingHold.create({
data: { slotId, userId, expiresAt: addMinutes(new Date(), 5) }
});
Also add a cleanup job or TTL-expiry mechanism so abandoned holds don't block slots indefinitely.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Booking Flow & Lifecycle Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-362 — Race Condition / TOCTOU
- iso-25010:2011 · reliability.fault-tolerance — Fault Tolerance — temporary slot hold prevents TOCTOU race at checkout
Taxons
History
- 2026-04-18·v1.0.0·Initial import from booking-flow-lifecycle·automated