T05 · Unauthorized Access and Privilege Escalation
- Location
openapi.json:10- Finding
Unauthenticated User-Scoped Operations Permit Potential IDOR
- Content
View full analysis
Vulnerability Details
File Location:
openapi.json:10-239, with affected request schemas atopenapi.json:289-401; corresponding usage documentation atSKILL.md:93-199
Vulnerability Type: Missing authentication and object-level authorization for user-scoped API operations
Risk Level: HighThe API contract exposes reminder and push-subscription operations that accept a caller-controlled numeric
userId. No authentication scheme, operation-level security requirement, or mechanism binding that identifier to an authenticated principal is declared.A representative affected operation is:
json "/api/reminders/list": { "post": { "summary": "List Reminders", "operationId": "list_reminders_api_reminders_list_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReminderListRequest" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }The referenced request model allows the caller to select the user:
json "ReminderListRequest": { "properties": { "userId": { "type": "integer", "title": "Userid" } }, "type": "object", "required": [ "userId" ], "title": "ReminderListRequest" }The same design is used by
/api/push/status,/api/push/unsubscribe,/api/reminders/delete, and/api/push/subscribe. The OpenAPI document contains nocomponents.securitySchemesdefinition and no global or operation-levelsecuritydeclaration.Technical Analysis
This desi ...[truncated 3136 chars]
- Remediation
View remediation
Remediation Suggestions
- Require authentication for every user-scoped reminder and push endpoint.
- Define the authentication mechanism in
components.securitySchemes, such as OAuth 2.0 or validated bearer tokens, and apply it globally or to every protected operation. - Derive the user identity exclusively from the validated session or access token. Do not trust a client-supplied
userIdas the authorization identity. - Remove
userIdfrom ordinary request bodies where possible. If administrative workflows require it, protect them with separate privileged scopes and explicit authorization checks. - Enforce object-level authorization for every reminder operation by verifying that the requested
reminderIdbelongs to the authenticated principal. - For push subscription updates and deletion, verify that the authenticated principal owns the subscription being modified.
- Prevent silent replacement of existing push subscriptions without authenticated confirmation and appropriate auditing.
- Return generic authorization failures that do not reveal whether another user's resource exists.
- Apply rate limiting and anomaly detection to reduce identifier enumeration.
- Prefer non-sequential, high-entropy public identifiers as defense in depth, while retaining mandatory authorization checks.
- Add automated negative tests proving that one authenticated user cannot list, delete, inspect, unsubscribe, or replace another user's resources.
- Document all authorization requirements and expected
401 Unauthorizedand403 Forbiddenresponses in the OpenAPI specification. - Minimize response data from push-status operations; avoid returning endpoint details unless they are strictly required by an authenticated client.
