- Purpose: Provide a practical checklist and remediation guidance for authorizing routes, preventing BOLA/IDOR, enforcing RBAC, verifying JWT usage, and closing privilege escalation vectors.
- Audience: Backend engineers, security reviewers, and dev teams auditing Express apps for authorization issues.
- Output: A reproducible checklist, example code snippets for fixes, proof-of-concept notes, and prioritized remediation steps.
Additional items to check

- Multi-tenant isolation must be enforced server-side. Client-side tenant selectors are not a security boundary.
- Bulk operations must check ownership at the per-item level; do not assume the caller is authorized for every item in a batch.
- Field-level authorization (or server-side projection) is required to avoid leaking sensitive fields.
- Use a consistent error policy to avoid resource enumeration: choose 403 for authenticated-but-unauthorized; use 404 only when intentionally hiding existence.
- Middleware ordering must always be: authentication (authN) → authorization (authZ) → handler. Misordered middleware is a common bypass.
- Who can access it? (roles, scopes, tenant)
- What data can they see or modify (including hidden fields)?
- Are ownership/tenancy checks enforced (query-level filter + post-fetch verification)?
- Are authN/authZ middleware enforced consistently and in the correct order?
- Title, Severity (Critical/High/Medium/Low), CWE (if applicable)
- Evidence (file, function, line ranges)
- Short explanation: Why it matters
- Exploitability notes and safe PoC steps (no real secrets)
- Remediation: precise code-level fix or config change (include snippets)
- Defense-in-depth guidance
- Summary risk score (0–10) and top prioritized fixes
- Checklist diff: which items are Pass / Fail / N/A
Authorization failures are often catastrophic. If you find missing authorization middleware, weak JWT validation, or endpoints that accept role changes from clients, treat these as critical and fix them before any production deployment.
- Weak / incomplete JWT issuance
- Enforce ownership on object-level routes
/:id may be vulnerable to BOLA/IDOR if they do not verify resource ownership.
Remediation (authorization middleware):
- Authentication middleware must run before route handlers
- Authorization Security Assessment Complete
- Risk Score: 9.5/10 (Critical)
- No authentication middleware — endpoints are unprotected.
- Weak JWT implementation — missing algorithm, issuer, audience validation.
- Default secrets present — allows token forgery.
- No authorization framework — vulnerable to BOLA/IDOR.
- Replace default JWT secret with a 256-bit cryptographically secure value.
- Implement authentication middleware before adding any protected endpoints.
- Configure JWT verification to require
algorithms,issuer, andaudience, and ensure expiration (exp) is enforced. - Disallow client-side role or tenant updates; accept those only via server-side admin flows.
- Application: comprehensive authN/authZ middleware, RBAC mapping, and field-level filtering.
- Infrastructure: rate limiting, WAF, secure defaults for secrets and environment variables.
- Database: enforce row-level security when available (e.g., PostgreSQL RLS) and use least-privilege DB users.
- Monitoring: log auth events and alert on suspicious access patterns.
- Testing: automated tests for BOLA/IDOR, RBAC, and token validation in CI.
- Title, Severity, CWE, Evidence (file/function/line ranges), Why it matters.
- Safe reproduction steps and remediation code snippets.
- A prioritized list of fixes and a checklist diff (Pass/Fail/N/A).
Use short-lived access tokens (e.g., 15 minutes) and implement a refresh token mechanism with strict rotation and revocation. Always validate
algorithms, iss, and aud in jwt.verify, and ensure token expiration (exp) checks are enforced.