
- Authorization implementation across all routes and endpoints.
- Broken Object Level Authorization (BOLA / IDOR).
- Broken Function Level Authorization.
- Missing authorization checks on sensitive endpoints (admin, bulk, debug).
- Role-based access control (RBAC) correctness and deny-by-default enforcement.
- Privilege escalation paths via update flows or misapplied defaults.
- JWT validation on protected routes and token revocation checks.
- Proper scope checking for API/service tokens and multi-tenant isolation.
- Field-level authorization, bulk protections, and consistent error handling.
High-level summary (assessment snapshot)
- Risk Score: 9.5/10 (Critical)
- Critical issues identified:
- No authentication/authorization middleware — endpoints are unprotected beyond login.
- Weak JWT implementation — missing strict verification parameters; possible default secrets.
- No RBAC or object-level authorization — vulnerable to BOLA/IDOR.
- Inconsistent error handling — may leak resource existence.
This assessment indicates the application should not handle real user data in its current state. Immediate remediation is required before any production deployment.
- Authentication middleware (verify JWT)
- Issuing JWTs with recommended claims (login handler)
- Object-level ownership authorization (authorizeOwnership middleware)
- Applying middleware and enforcing authN -> authZ -> handler order
- Replace any default JWT secret (e.g., JWT_SECRET=your_jwt_secret_key_here) with a strong secret (256-bit recommended) stored in a secure secret manager.
- Implement and apply authentication middleware (jwt.verify with algorithms/issuer/audience) across all protected routes before any business logic.
- Add object-level ownership checks for all /:id and object-access routes; enforce deny-by-default for RBAC decisions.
- Audit and remove or strictly protect debug/admin routes (e.g.,
/seed,/reset,/debug) in production. - Normalize error handling to avoid resource enumeration (use 404 for not-found and 403 for explicit access-denied where appropriate).
- Title, Severity, CWE (if applicable)
- Evidence (file/function/lines)
- Why it matters
- Exploitability notes
- Minimal PoC (safe)
- Code-level remediation snippets
- Defense-in-depth guidance and recommended tests
- LLMs synthesize examples from many sources and may suggest working but insecure defaults (weak secrets, missing validations). Treat generated code as a starting point: run automated security tests and manual code review to harden before production.
- Input validation and sanitization for user- or bot-controlled inputs (prevent SQLi, injection).
- Rate limiting and brute-force protections for sensitive routes.
- Token revocation and refresh token patterns (rotate and revoke via tokenVersion/jti).
- Logging, monitoring, and alerting for suspicious authorization failures.
- Prompts and automation: https://github.com/JeremyMorgan/Claude-Code-Reviewing-Prompts
- JSON Web Tokens: https://jwt.io/
- OWASP Broken Access Control: https://owasp.org/www-project-top-ten/2017/A5_2017-Broken_Access_Control