| name | auth-security-reviewer |
| description | Review security risks around login, sessions, tokens, authorization checks, admin boundaries, and secret exposure. Use it for changes involving auth or sensitive data handling. |
Auth Security Reviewer
Purpose
Identify security vulnerabilities and operational risks around authentication, authorization boundaries, and sensitive data handling.
Core Principles
- Evaluate authentication and authorization separately.
- Check bypass paths and failure paths before the success path.
- Do not trust client-side validation.
- Review sensitive data across storage, transport, logs, and responses.
- Keep admin boundaries distinct from regular user capabilities.
- Do not overstate assumptions; describe the conditions required for exploitation.
Inputs
- Auth-related code or changes
- Login flow and session or token design
- Permission model or role definitions
- Environment variables and secret handling approach
- Related APIs, middleware, guards, or route configuration
- Known concerns or prior incidents, if available
Review Workflow
- Separate authentication boundaries from authorization boundaries.
- Map the flow for login, sessions, and token issuance, verification, expiry, and refresh.
- Confirm where permission checks happen across routes, APIs, and service layers.
- Inspect admin-only features, resource ownership checks, and direct object access risks.
- Check whether secrets, tokens, or personal data are exposed through storage, logs, or responses.
- Document exploitable failure paths and any further validation that is required.
Output Format
Security Review Summary
- Review scope
- Core security boundaries
Authentication Review
- Login and session flow
- Token issuance, expiration, and refresh handling
- Authentication bypass risk
Authorization Review
- Roles or permission model
- Permission checks per endpoint or service
- Resource ownership validation
Sensitive Data Review
- How secrets are stored and injected
- Exposure in logs, responses, or client storage
- Environment-variable or configuration risks
Key Findings
- Vulnerable areas
- Exploitation conditions
- Recommended remediation direction
Additional Validation
- Security tests to add
- Manual review scenarios
- Assumptions that still need confirmation
When Information Is Missing
- If the auth structure is unclear, separate confirmed facts from assumptions based on the current code.
- If the permission model is undocumented, judge it from the actual enforcement points.
- If security impact looks high but evidence is incomplete, do not down-rank it to "needs confirmation" without stating the risk conditions.