Both dispute privilege-escalation issues fixed in backend disputeRoutes.ts. Index updated: 51 open (12 critical), 2 resolved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
issue, title, severity, domain, labels, status, resolved, fix, created, source
| issue | title | severity | domain | labels | status | resolved | fix | created | source | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 001 | PATCH /api/disputes/:id/status and POST /api/disputes/:id/resolve have no role guard — privilege escalation | critical | Dispute |
|
resolved | 2026-05-29 | Added authorizeRoles('admin') middleware to PATCH /:id/status and POST /:id/resolve in backend/src/routes/disputeRoutes.ts | 2026-05-29 | Doc vs Code Audit 2026-05-29 |
🔴 PATCH /api/disputes/:id/status and POST /api/disputes/:id/resolve have no role guard — privilege escalation
Severity: critical Domain: Dispute Labels: security, bug, backend, privilege-escalation
Description
Any authenticated buyer or seller can change dispute status to 'resolved', 'closed', or 'rejected', and can post a dispute resolution including action=ban_seller. Neither the dashboard updateStatus controller nor the resolveDispute controller call authorizeRoles('admin'). Only authenticateToken is applied on the router.
Current Behavior
Any authenticated user with the dispute ID can call PATCH /api/disputes/:id/status or POST /api/disputes/:id/resolve and receive 200 with the mutation applied.
Expected Behavior
Both endpoints should return 403 for non-admin users. authorizeRoles('admin') middleware should be applied at the route level.
Affected Files
backend/src/routes/disputeRoutes.tsbackend/src/controllers/disputeController.ts