Advance booking limits enforced server-side with a structured error response
Why it matters
Advance booking limits that exist only as a UI filter are not limits at all. A direct POST to the booking API skips the date picker entirely. OWASP A03 (Injection) and CWE-20 (Improper Input Validation) apply to any business rule that can be bypassed by sending a raw HTTP request. Without a server-side ceiling, a misbehaving client can book a slot 5 years in the future, creating junk data in the schedule, blocking the resource for phantom appointments, and polluting analytics.
Severity rationale
Low because far-future junk bookings are annoying and pollute analytics but do not expose sensitive data or create immediate revenue loss, making it lower urgency than buffer or duration violations.
Remediation
Define MAX_ADVANCE_DAYS as a server-side constant and validate it in the booking API handler. The check belongs next to duration and cutoff validation so all time-boundary rules are visible in one file.
// src/app/api/book/route.ts
const MAX_ADVANCE_DAYS = 90
export async function POST(req: Request) {
const { startTime } = await req.json()
const requested = new Date(startTime)
const ceiling = new Date(Date.now() + MAX_ADVANCE_DAYS * 86_400_000)
if (requested > ceiling) {
return Response.json(
{
error: 'Booking too far in advance',
detail: `Bookings cannot exceed ${MAX_ADVANCE_DAYS} days from today`,
},
{ status: 400 }
)
}
// ... create booking
}
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 Calendar & Availability Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-20 — Improper Input Validation — advance booking limit not enforced server-side
- owasp:2021 · A03 — Injection — advance booking constraints bypassed via direct API call
Taxons
History
- 2026-04-18·v1.0.0·Initial import from booking-calendar-availability·automated