Back to skills
SKILL.md
Api Security Testing
BSecurityAPI testing checklist: fuzzing, schema abuse, IDOR on endpoints
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added November 29, 2026
Works with
Security analysis
88/100- Accesses sensitive system or user directories
npx -y skills add blackfoxxx/kestrel --skill api-security-testing --agent claude-codeAre you the author of Api Security Testing?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/blackfoxxx-api-security-testing)---
name: api-security-testing
description: "API testing checklist: fuzzing, schema abuse, IDOR on endpoints"
version: 1.0.0
mcps: autopen, pentest mcp
---
# API Security Testing
## Overview
API security testing is a critical step in ensuring the security of API interfaces. This skill provides methods, tools, and best practices for API security testing.
## Testing Scope
### 1. Authentication and Authorization
**Test items:**
- Token validity verification
- Token expiration handling
- Access control
- Role permission verification
### 2. Input Validation
**Test items:**
- Parameter type validation
- Data length limits
- Special character handling
- SQL injection protection
- XSS protection
### 3. Business Logic
**Test items:**
- Workflow verification
- State transitions
- Concurrency control
- Business rules
### 4. Error Handling
**Test items:**
- Error message leakage
- Stack traces
- Sensitive information exposure
## Testing Methods
### 1. API Discovery
**Identifying API endpoints:**
```bash
# Use directory scanning
gobuster dir -u https://target.com -w api-wordlist.txt
# Use Burp Suite passive scanning
# Browse the application and observe API calls
# Analyze JavaScript files
# Look for API endpoint definitions
```
### 2. Authentication Testing
**Token testing:**
```http
# Test an invalid Token
GET /api/user
Authorization: Bearer invalid_token
# Test an expired Token
GET /api/user
Authorization: Bearer expired_token
# Test with no Token
GET /api/user
```
**JWT testing:**
```bash
# Use jwt_tool
python jwt_tool.py <JWT_TOKEN>
# Test algorithm confusion
python jwt_tool.py <JWT_TOKEN> -X a
# Test secret-key brute forcing
python jwt_tool.py <JWT_TOKEN> -C -d wordlist.txt
```
### 3. Authorization Testing
**Horizontal privileges:**
```http
# User A accessing User B's resource
GET /api/user/123
Authorization: Bearer user_a_token
# Should return 403
```
**Vertical privileges:**
```http
# A regular user accessing an admin interface
GET /api/admin/users
Authorization: Bearer user_token
# Should return 403
```
### 4. Input Validation Testing
**SQL injection:**
```http
POST /api/search
{
"query": "test' OR '1'='1"
}
```
**Command injection:**
```http
POST /api/execute
{
"command": "ping; id"
}
```
**XXE:**
```http
POST /api/parse
Content-Type: application/xml
<?xml version="1.0"?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
<foo>&xxe;</foo>
```
### 5. Rate Limiting Testing
**Testing rate limits:**
```python
import requests
for i in range(1000):
response = requests.get('https://target.com/api/endpoint')
print(f"Request {i}: {response.status_code}")
```
## Tool Usage
### Postman
**Creating a test collection:**
1. Import the API documentation
2. Set up authentication
3. Create test cases
4. Run automated tests
### Burp Suite
**API scanning:**
1. Configure the API endpoints
2. Set up authentication
3. Run an active scan
4. Analyze the results
### OWASP ZAP
```bash
# API scan
zap-cli quick-scan --self-contained \
--start-options '-config api.disablekey=true' \
http://target.com/api
```
### REST-Attacker
```bash
# Scan an OpenAPI specification
rest-attacker scan openapi.yaml
```
## Common Vulnerabilities
### 1. Authentication Bypass
**Token verification flaws:**
- Weak Token generation
- Predictable Tokens
- Tokens with unverified signatures
### 2. Privilege Escalation
**IDOR:**
- Insecure direct object references
- Unverified resource ownership
### 3. Information Disclosure
**Error messages:**
- Detailed error messages
- Stack traces
- Sensitive data
### 4. Injection Vulnerabilities
**Common injections:**
- SQL injection
- NoSQL injection
- Command injection
- XXE
### 5. Business Logic
**Logic flaws:**
- Price manipulation
- Quantity limit bypass
- State modification
## Testing Checklist
### Authentication Testing
- [ ] Token validity verification
- [ ] Token expiration handling
- [ ] Weak Token detection
- [ ] Token replay attacks
### Authorization Testing
- [ ] Horizontal privilege testing
- [ ] Vertical privilege testing
- [ ] Role permission verification
- [ ] Resource access control
### Input Validation
- [ ] SQL injection testing
- [ ] XSS testing
- [ ] Command injection testing
- [ ] XXE testing
- [ ] Parameter pollution
### Business Logic
- [ ] Workflow verification
- [ ] State transitions
- [ ] Concurrency control
- [ ] Business rules
### Error Handling
- [ ] Error message leakage
- [ ] Stack traces
- [ ] Sensitive information exposure
## Protective Measures
### Recommended Approaches
1. **Authentication**
- Use strong Tokens
- Implement Token refresh
- Verify Token signatures
2. **Authorization**
- Role-based access control
- Resource ownership verification
- Principle of least privilege
3. **Input Validation**
- Parameter type validation
- Data length limits
- Allowlist validation
4. **Error Handling**
- Unified error responses
- Do not leak detailed information
- Log errors
5. **Rate Limiting**
- Implement API throttling
- Prevent brute forcing
- Monitor anomalous requests
## Notes
- Only perform testing in authorized test environments
- Avoid impacting the API
- Be mindful of differences between API versions
- Watch your request frequency during testing
Attribution
Related skills
View all in security →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.