T05 · Unauthorized Access and Privilege Escalation
- Location
openapi.json:588- Finding
Booking Data and Cancellation Operations Lack Declared Authentication
- Content
View full analysis
Vulnerability Details
File Location:
openapi.json:588-704
Vulnerability Type: Broken object-level authorization caused by reliance on caller-controlled user identifiers
Risk Level: HighVulnerable Code
json "/bookings": { "post": { "summary": "Create Booking", "description": "Create a new booking", "operationId": "create_booking_bookings_post", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BookingCreate" } } } } }, "get": { "summary": "Get Bookings", "description": "Get all bookings for a user", "operationId": "get_bookings_bookings_get", "parameters": [ { "name": "user_id", "in": "query", "required": true, "schema": { "type": "string", "title": "User Id" } } ] } }, "/bookings/{booking_id}": { "delete": { "summary": "Cancel Booking", "description": "Cancel a booking", "operationId": "cancel_booking_bookings__booking_id__delete", "parameters": [ { "name": "booking_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Booking Id" } }, { "name": "user_id", "in": "query", "required": true, "schema": { "type": "string", "title": "User Id" } } ] } }Technical Analysis
The OpenAPI contract declares neither a global authentication requirement nor operation-level
securityrequirements. Itscomponentssection also contains nosecuritySchemes. Access to all bookings and cancellation operations is represented as depending only on caller-supplieduser_idand `book ...[truncated 1864 chars]- Remediation
View remediation
Remediation Suggestions
- Define and enforce OAuth 2.0, signed API keys, or authenticated sessions through an OpenAPI
securitySchemesentry and global or operation-levelsecurityrequirements. - Derive the acting user identity from validated credentials rather than accepting
user_idas authorization evidence. - On every object access, verify that the authenticated principal owns or is explicitly authorized to access the requested booking.
- Use opaque, high-entropy booking identifiers as defense in depth, while retaining mandatory ownership checks.
- Return
401 Unauthorizedwhen credentials are missing and403 Forbiddenwhen the principal lacks access. - Apply equivalent authorization checks to event types, availability, blocked dates, user settings, renewals, and Google Calendar operations.
- Add automated negative tests that attempt cross-account reads, updates, and deletions with valid credentials from a different user.
- Document all security requirements in the API specification so generated clients cannot invoke sensitive operations as though they were public.
- Define and enforce OAuth 2.0, signed API keys, or authenticated sessions through an OpenAPI
