Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
Role definitions testing evaluates how well an application implements role-based access control (RBAC). This test identifies whether roles are properly defined, whether users can only access resources appropriate for their role, and whether role hierarchies are correctly enforced. Poorly defined roles can lead to privilege escalation and unauthorized access to sensitive functionality.
What to Check
Role Definition Analysis
Documented role definitions exist
Roles follow principle of least privilege
Role separation is properly implemented
Administrative roles are properly restricted
Role hierarchy is clearly defined
Access Control Verification
Check
Description
Role boundaries
Each role can only access assigned resources
Privilege separation
Sensitive functions require specific roles
Role escalation
Users cannot self-assign higher roles
Cross-role access
Users cannot access other role's data
How to Test
Step 1: Enumerate Available Roles
# Review application documentation for role definitions# Common roles to look for:# - Guest/Anonymous# - User/Member# - Moderator# - Administrator# - Super Admin# Check user profile endpoints for role information
curl -s -H "Authorization: Bearer $TOKEN" \
"https://target.com/api/user/profile" | jq '.role'# Check for role-related parameters
curl -s -H "Authorization: Bearer " \
| jq
$TOKEN
"https://target.com/api/users/me"
'.permissions'
Step 2: Map Role Permissions
#!/bin/bash# Create accounts for each role and map accessible endpoints
ROLES=("user""moderator""admin")
ENDPOINTS=(
"/api/users""/api/users/1""/api/admin/settings""/api/admin/users""/api/reports""/api/logs"
)
for role in"${ROLES[@]}"; doecho"=== Testing role: $role ==="# Use token for this role
TOKEN=$(cat"tokens/${role}_token.txt")
for endpoint in"${ENDPOINTS[@]}"; do
status=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer $TOKEN" \
"https://target.com${endpoint}")
echo"$endpoint: $status"doneecho""done
Step 3: Test Role Boundary Violations
# Test if lower-privileged role can access admin functions# Using regular user token
curl -s -H "Authorization: Bearer $USER_TOKEN" \
"https://target.com/api/admin/users" \
-w "\nStatus: %{http_code}"# Test if user can modify their own role
curl -s -X PUT \
-H "Authorization: Bearer $USER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"role": "admin"}' \
"https://target.com/api/user/profile"# Test parameter manipulation
curl -s -X POST \
-H "Authorization: Bearer $USER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"username": "test", "role": "admin"}' \
"https://target.com/api/users"
Step 4: Test Horizontal Access Between Same Roles
# User A trying to access User B's resources
curl -s -H "Authorization: Bearer $USER_A_TOKEN" \
"https://target.com/api/users/2/profile"# User A trying to modify User B's data
curl -s -X PUT \
-H "Authorization: Bearer $USER_A_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email": "attacker@evil.com"}' \
"https://target.com/api/users/2/profile"
Step 5: Verify Role Enforcement Consistency
# Check if role is enforced on all endpoints# Sometimes GET is protected but POST is not# Test different HTTP methodsfor method in GET POST PUT DELETE PATCH; do
status=$(curl -s -o /dev/null -w "%{http_code}" \
-X $method \
-H "Authorization: Bearer $USER_TOKEN" \
"https://target.com/api/admin/settings")
echo"$method /api/admin/settings: $status"done
Tools
Automated Testing
Tool
Description
Usage
Burp Suite Autorize
Access control testing
Automatic re-request with different sessions
OWASP ZAP Access Control
Automated role testing
Context-based access testing
AuthMatrix
Burp extension
Matrix-based authorization testing
Manual Testing
Tool
Description
Burp Suite
Intercept and modify role parameters
Postman
Create collections for different roles
curl
Command-line HTTP testing
Example Commands/Payloads
Role Manipulation Payloads
// User registration with role injection{"username":"attacker","password":"password123","email":"attacker@test.com","role":"admin"}// Profile update with role escalation{"name":"Attacker","role":"administrator","isAdmin":true,"permissions":["all"]}// JWT manipulation (if applicable)// Original: {"sub":"user123","role":"user"}// Modified: {"sub":"user123","role":"admin"}