authorization-implementation
Skill15 starsChanged 5 months agoCC0-1.0View on GitHub
Analyzes authorization and access-control logic across routes and resources for privilege and enforcement flaws. Use when auditing authorization, RBAC, or access control.
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 12 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
If no target path is given above, review the entire codebase.
- Very specific: line 26
Verify ownership/tenant checks on all object-level routes (GET/PUT/DELETE /:id).
- Distinctive: line 27
Ensure identifiers in URL, body, or query cannot be manipulated to access others’ data.
- Distinctive: line 32
Ensure enforcement is server-side, not just in the UI.
- Distinctive: line 42
Ensure roles cannot be set/changed by the client.
- Very specific: line 46
Check for update endpoints allowing fields like role, tenantId, or isAdmin.
- Very specific: line 52
Ensure no route uses jwt.decode or trusts unverified claims.
- Distinctive: line 57
Verify least-privilege scopes are enforced.
- Distinctive: line 76
Ensure field-level projection or serializer logic exists.
- Distinctive: line 86
Check nested routers for missing parent auth guards.
- Distinctive: line 90
No wildcard origins with credentials.
- Distinctive: line 91
If cookies are used for auth, CSRF defenses are in place (SameSite, CSRF token).
- Very specific: line 95
Verify post-login redirect/next parameters are validated against allowlists.
- Very specific: line 99
Ensure no /seed, /reset, /debug endpoints are left exposed without strict admin checks.
- Distinctive: line 129
Prefer minimal, drop-in fix snippets over prose.
- Distinctive: line 131
Do not invent files or functions that aren’t present.
- Distinctive: line 133
Write this into a markdown file and place it in the audits/ folder.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Target: $ARGUMENTS
If no target path is given above, review the entire codebase.
Authorization Implementation
Analyze authorization implementation across all routes:
Check for:
Broken Object Level Authorization (BOLA / IDOR)
- Verify ownership/tenant checks on all object-level routes (
GET/PUT/DELETE /:id). - Ensure identifiers in URL, body, or query cannot be manipulated to access others’ data.
- Verify ownership/tenant checks on all object-level routes (
Broken Function Level Authorization
- Confirm role/permission checks exist on every privileged route.
- Ensure enforcement is server-side, not just in the UI.
Missing authorization checks on sensitive endpoints
- Validate middleware ordering (authN → authZ → handler).
- Confirm no endpoints are left exposed (admin tools, bulk exports, feature-flagged routes).
Role-based access control (RBAC) implementation
- Map roles → permissions explicitly; enforce deny-by-default.
- Ensure roles cannot be set/changed by the client.
Privilege escalation possibilities
- Check for update endpoints allowing fields like
role,tenantId, orisAdmin. - Validate multi-step workflows cannot escalate privileges indirectly.
- Check for update endpoints allowing fields like
JWT token validation on every protected route
- Require
jwt.verifywith strictalgorithms,iss,aud,exp. - Ensure no route uses
jwt.decodeor trusts unverified claims. - Validate
jtiortokenVersionagainst revocation strategy.
- Require
Proper scope checking for API tokens
- Verify least-privilege scopes are enforced.
- Differentiate user tokens vs service tokens; enforce
audienceand intended route access.
Additional items to check for:
Multi-tenant isolation
- Tenant constraints injected server-side, not client-provided.
- List/search endpoints filtered by tenant at query time.
Bulk endpoint protections
- Batch/bulk operations enforce ownership per item, not just once at entry point.
Field-level authorization
- Sensitive fields (e.g.,
ssn,apiKey,secrets) excluded for non-privileged users. - Ensure field-level projection or serializer logic exists.
- Sensitive fields (e.g.,
Error handling & resource enumeration
- Uniform errors (
403vs404) to prevent leaking resource existence. - Consistent status codes across owned vs non-owned resources.
- Uniform errors (
Middleware ordering
- Confirm routes cannot bypass authorization due to wrong order (e.g., handler before auth middleware).
- Check nested routers for missing parent auth guards.
CORS & CSRF considerations
- No wildcard origins with credentials.
- If cookies are used for auth, CSRF defenses are in place (SameSite, CSRF token).
Open redirect protections
- Verify post-login
redirect/nextparameters are validated against allowlists.
- Verify post-login
Fallback/debug routes
- Ensure no
/seed,/reset,/debugendpoints are left exposed without strict admin checks.
- Ensure no
For each endpoint, verify:
- Who can access it (roles, scopes, tenant).
- What data they can see/modify (including hidden fields).
- Whether ownership/tenancy is properly checked (query-level filter + post-fetch check).
- That middleware enforces authN/authZ consistently (no bypass possible).
Provide:
A structured finding report with the following for each issue:
Title, Severity (Critical/High/Medium/Low), CWE (if applicable), Evidence (file, function, line ranges), and a short Why it matters.
Exploitability notes and, where safe, a minimal PoC or reproduction steps (no real secrets).
Remediation: precise code-level fix or config change (snippets welcome), plus defense-in-depth guidance.
A summary risk score (0–10) and top 3–5 prioritized fixes that reduce risk fastest.
A checklist diff: which items from the “Check for” list are Pass/Fail/Not Applicable.
Constraints & style:
Be concrete and cite exact code locations and identifiers.
Prefer minimal, drop-in fix snippets over prose.
Do not invent files or functions that aren’t present; if context is missing, mark as Unable to verify and say what code would prove it.
Write this into a markdown file and place it in the audits/ folder.
In this repository21 other files it gives its agents.
- api-and-infrastructureSkill
- authentication-flow-reviewSkill
- business-logic-vulnerabilitiesSkill
- code-duplication-detectionSkill
- code-quality-metrics-standardsSkill
- comprehensive-security-reportSkill
- database-securitySkill
- design-pattern-implementationSkill
- error-handling-resilienceSkill
- exception-flow-analysisSkill
- file-handling-business-logicSkill
- initial-security-analysisSkill
- initial-software-design-analysisSkill
- input-validationSkill
- logging-monitoringSkill
- readability-and-namingSkill
- resilience-fault-toleranceSkill
- secrets-management-auditSkill
- session-cookie-securitySkill
- solid-principlesSkill
- testing-implementationSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

