Files
Claude c5924cc009 Ajoute 16 skills de sécurité (sélection web/API)
Tirés de mukul975/anthropic-cybersecurity-skills (commit 54a7988,
Apache-2.0) : contrôle d'accès/IDOR, en-têtes et CSP, CORS, OAuth, JWT,
XSS, fonctions serverless, rate limiting, paquets npm, gitleaks, RGPD,
OWASP API Top 10. Les 800 autres (offensifs, Windows/AD, forensique…)
sont laissés de côté. Voir .claude/skills/README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
2026-10-08 17:36:57 +00:00

2.0 KiB

API Reference: Testing for Broken Access Control

requests Library

Authentication Patterns

# Bearer token authentication
headers = {"Authorization": "Bearer <token>", "Content-Type": "application/json"}

# Cookie-based authentication
cookies = {"session": "session_value"}

# Multiple methods
resp = requests.request("DELETE", url, headers=headers)

Test Categories

Vertical Privilege Escalation

Test admin endpoints with regular user credentials:

for endpoint in admin_endpoints:
    resp = requests.get(url, headers=user_headers)
    # 200 = VULNERABLE, 403 = properly restricted

Horizontal Privilege Escalation (IDOR)

Access other users' resources:

# Replace {id} with other user's ID
resp = requests.get(f"/api/users/{other_id}/profile", headers=user_headers)

HTTP Method Override

override_headers = ["X-HTTP-Method-Override", "X-Method-Override", "X-HTTP-Method"]

Mass Assignment Fields

Field Description
role User role (admin, user)
is_admin Boolean admin flag
permissions Permission array
access_level Numeric access level
user_type User type classification

Response Status Interpretation

Status Meaning
200/201 Access granted (potential vulnerability if unexpected)
401 Not authenticated
403 Authenticated but not authorized (correct behavior)
404 Resource not found (may hide from unauthorized users)
405 Method not allowed

OWASP References