/appsec:privilege-escalationfrom appsec
Analyzes source code for privilege escalation threats including broken access control, IDOR, JWT manipulation, role confusion, and missing function-level access control. Maps to STRIDE category E.
Ships in appsec. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Analyze source code for privilege escalation threats where attackers can gain unauthorized capabilities or access. Maps to STRIDE E -- violations of the Authorization security property.
Read ../../shared/schemas/flags.md for the full flag specification. This skill supports all cross-cutting flags including --scope, --depth, --severity, --format, --fix, --quiet, and --explain.
Read ../../shared/frameworks/stride.md, specifically the E - Elevation of Privilege section, for the threat model backing this analysis. Key concerns: broken access control (IDOR), missing function-level access control, JWT manipulation, role confusion, privilege escalation.
Parse flags and resolve the target file list per the flags spec. Filter to files implementing authorization:
For each in-scope file, apply the Analysis Checklist below. At --depth standard, examine authorization logic in each file. At --depth deep, map the full authorization architecture: who can access what, where checks are enforced, where gaps exist between routes, and whether authorization is consistently applied at every layer.
Output findings per ../../shared/schemas/findings.md using the PRIV ID prefix (e.g., PRIV-001). Set references.stride to "E" on every finding.
Work through these questions against the scoped code. Each "yes" may produce a finding.
isAdmin, requireRole('admin'), or @permission_required, identify sibling routes that should but do not have equivalent guards. Map all endpoints and flag gaps in the authorization layer.findById(req.params.id), getRecord(id) where the result is not checked against the requesting user's permissions or tenant. Test: can user A access user B's resources by changing the ID?jwt.decode without verify, or role checks solely from token claims.role, isAdmin, canAccess in frontend code and verify equivalent checks exist server-side.isAdmin, permissions, or group fields through API requests? Look for ORM .create(req.body) or .update(req.body) without excluding privilege-related fields. Check for attr_accessible, fillable, $guarded, or DTO validation that strips role fields.role: 'admin' combined with password: in seed data. Check if these are gated behind environment checks (if NODE_ENV === 'development').WHERE user_id = ? or WHERE org_id = ?) or if they rely solely on the resource ID from the request. Multi-tenant applications must enforce tenant isolation on every query.editor can perform admin actions, or if role inheritance has gaps. Look for permission checks using string comparison (if role === 'admin') instead of hierarchical evaluation that accounts for role inheritance.next() called unconditionally in auth middleware./api/admin/../user/settings to bypass admin-only middleware, or using URL encoding tricks to evade path-based access rules.scope: *, full permissions, or if fine-grained scopes are available but not enforced. Look for scope validation at the endpoint level, not just at token issuance.findById(req.params.id) is an IDOR -- some resources are intentionally public (e.g., blog posts, product listings). Focus on resources that contain user-private data.admin / user) is not a finding. Flag only when the code shows evidence of an intended hierarchy that is inconsistently enforced.Concrete code patterns and grep heuristics to surface privilege escalation risks:
/admin, /manage, /internal, /dashboard, /settings without auth middleware. Compare middleware chains between admin and public routes. Grep: (admin|manage|internal|dashboard) in route definitions.Model.findById(req.params.id) or db.query("SELECT ... WHERE id = $1", [req.params.id]) without a user_id or org_id filter joined to the session user. Grep: findById\s*\(\s*req\.(params|query)|WHERE id\s*= without ownership clause.req.body.role, request.data['is_admin'], params[:role] used in user creation or update without stripping. Also req.user.role derived solely from JWT without server-side lookup. Grep: req\.(body|query|params)\.(role|isAdmin|is_admin|permissions|group).app.use(authMiddleware) placement relative to route definitions. Grep: app\.(get|post|put|delete|use)\s*\( to map registration order.permission: '*', role: 'superadmin' granted broadly, if (user.role) { allow } checking role existence rather than specific role value. Grep: permission.*\*|role.*super|if\s*\(\s*user\.(role|admin).authorized: true as default, access: 'public' on sensitive resources, missing else deny in conditional authorization. Grep: authorized.*true|access.*public|default.*allow..create(req.body), Object.assign(user, req.body), **request.data without exclude_fields or pick for role/permission attributes. Grep: \.create\(\s*req\.body|Object\.assign\(.*req\.body|\.update\(\s*\{.*\.\.\.req.Each finding must conform to ../../shared/schemas/findings.md.
id: PRIV-<NNN>
severity: critical | high | medium | low
confidence: high | medium | low
location: file, line, function, snippet
description: What the privilege escalation path is and how it can be exploited
impact: What unauthorized capabilities an attacker gains
fix: Concrete remediation with diff when possible
references:
stride: "E"
cwe: CWE-269 (Improper Privilege Mgmt), CWE-639 (IDOR), or relevant CWE
metadata:
tool: privilege-escalation
framework: stride
category: E
| Severity | Criteria |
|---|---|
critical | Admin endpoints without auth, mass assignment allowing role escalation to admin, IDOR on sensitive resources (financial data, PII, other users' accounts) |
high | Missing function-level access control on data modification endpoints, JWT role trust without server-side verification, broken tenant isolation |
medium | Horizontal privilege escalation on non-sensitive resources, client-only authorization, inconsistent permission checks across sibling endpoints |
low | Default admin in dev seeds, overly broad wildcard permissions in non-production config, missing deny-by-default on low-impact routes |
| CWE | Description |
|---|---|
| CWE-269 | Improper Privilege Management |
| CWE-639 | Authorization Bypass Through User-Controlled Key (IDOR) |
| CWE-862 | Missing Authorization |
| CWE-863 | Incorrect Authorization |
| CWE-285 | Improper Authorization |
| CWE-915 | Improperly Controlled Modification of Dynamically-Determined Object Attributes (Mass Assignment) |
| CWE-284 | Improper Access Control |
What SKILL.md sets; muted values are Claude Code's defaults
62 skills in this plugin
/access-controlThis skill should be used when the user asks to "check for access control issues", "analyze authorization", "find IDOR vulnerabilities", "audit CORS configuration", "check for privilege escalation", or mentions "access control", "authorization", "IDOR", "CORS", "JWT tampering", or "directory traversal" in a security context. Maps to OWASP Top 10 2021 A01: Broken Access Control.
/apiThis skill should be used when the user asks to "check API security", "audit REST API", "find BOLA vulnerabilities", "check for mass assignment", "analyze API rate limiting", "detect excessive data exposure", or mentions "API security", "BOLA", "IDOR", "mass assignment", "rate limiting", "broken function-level authorization", "excessive data exposure", or "OWASP API Top 10" in a security context.
/attack-surfaceThis skill should be used when the user asks to "map attack surface", "list entry points", "inventory API endpoints", "find all inputs", "enumerate routes", "discover exposed endpoints", or "map external interfaces". Also triggers when the user asks about exposed APIs, form handlers, file upload endpoints, WebSocket handlers, CLI argument parsers, or wants to understand where external data enters the system.
/authThis skill should be used when the user asks to "check for authentication issues", "analyze auth", "find credential vulnerabilities", "review login security", "check session management", or mentions "authentication", "passwords", "MFA", "sessions", or "brute force" in a security context. Maps to OWASP Top 10 2021 A07: Identification and Authentication Failures.
/business-logicThis skill should be used when the user asks to "check business logic security", "find logic flaws", "audit workflow security", "check for coupon abuse", "detect negative amount exploits", "analyze state machine security", or mentions "business logic", "workflow bypass", "negative amount", "coupon abuse", "self-referral", "state manipulation", or "time-based exploit" in a security context.
/configThis skill should be used when the user asks to "configure security", "appsec settings", "security preferences", or invokes /appsec:config. Manages security tool preferences and thresholds.
npx claudepluginhub florianbuetow/claude-code --plugin appsecOther plugins' skills for the same job