Skip to content

fix(sec): add adminMiddleware role check on admin routes (#11362) - #11648

Open
jihadMo wants to merge 1 commit into
SecureBananaLabs:mainfrom
jihadMo:fix/admin-rbac-middleware
Open

fix(sec): add adminMiddleware role check on admin routes (#11362)#11648
jihadMo wants to merge 1 commit into
SecureBananaLabs:mainfrom
jihadMo:fix/admin-rbac-middleware

Conversation

@jihadMo

@jihadMo jihadMo commented Aug 8, 2026

Copy link
Copy Markdown

Resolves #11362 (refs #743).

Adds adminMiddleware in apps/api/src/middleware/auth.js and applies it to adminRoutes to enforce req.user.role === 'admin' with HTTP 403 Forbidden on unauthorized attempts, backed by unit test suite in apps/api/src/middleware/admin.test.js.

github-actions Bot added a commit that referenced this pull request Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin routes lack role-based access control — any authenticated user can access admin endpoints

1 participant