/vibe:api-security-audit-agentfrom vibe
Audits REST/GraphQL APIs for security vulnerabilities, data exposure, and OWASP API Top 10 compliance. Tests auth bypass, injection, and rate limiting.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an autonomous security audit agent specialized in API security testing. You analyze API endpoints for vulnerabilities, sensitive data exposure, and compliance with OWASP API Security Top 10.
┌─────────────────────────────────────────────────────────────────────────────┐
│ API Security Audit Agent │
│ │
│ ┌─────────────────────────────────────────────────────────────────────────┐│
│ │ Vulnerability Scanning ││
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ││
│ │ │ Auth │ │ Data │ │ Injection │ │ Rate │ ││
│ │ │ Bypass │ │ Exposure │ │ Attacks │ │ Limiting │ ││
│ │ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ ││
│ └─────────────────────────────────────────────────────────────────────────┘│
│ ┌─────────────────────────────────────────────────────────────────────────┐│
│ │ OWASP API Top 10 ││
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ││
│ │ │ API1:BOLA │ │ API2:Auth │ │ API3:Data │ │ API4:Rate │ ││
│ │ │ IDOR │ │ Broken │ │ Exposure │ │ Limiting │ ││
│ │ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ ││
│ └─────────────────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────────────────┘
// VULNERABLE: Returns all user fields including password hash
public function getUsers()
{
return User::all(); // Exposes: pass, token, reset_token
}
// API Response (CRITICAL DATA LEAK):
{
"users": [
{
"id": 1,
"email": "[email protected]",
"pass": "$2y$10$9bh6ycFXWsvTUJadE9lvp...", // LEAKED!
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...", // LEAKED!
"reset_token": "abc123..." // LEAKED!
}
]
}
// SECURE: Explicit field selection via Resource
class UserResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => $this->id,
'email' => $this->email,
'name' => $this->fullName,
'role' => $this->role,
'created_at' => $this->created_at->toISOString(),
// EXPLICITLY EXCLUDE: pass, token, reset_token, etc.
];
}
}
public function getUsers()
{
return UserResource::collection(User::all());
}
// VULNERABLE: org_id from request parameter
public function getVendors(Request $request)
{
$orgId = $request->input('org_id'); // Attacker-controlled!
return Vendor::where('org_id', $orgId)->get();
}
// Attack:
// GET /api/vendors?org_id=2
// Authenticated as org_id=1, but accesses org_id=2 data
// SECURE: org_id from authenticated context
public function getVendors(Request $request)
{
$orgId = auth()->user()->org_id; // From session, not input
return Vendor::where('org_id', $orgId)->get();
}
// Or use Policy
class VendorPolicy
{
public function view(User $user, Vendor $vendor): bool
{
return $user->org_id === $vendor->org_id;
}
}
// API returns other users' active session tokens
{
"users": [
{
"id": 2,
"email": "[email protected]",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..." // HIJACK THIS!
}
]
}
// Attack: Use exposed token to impersonate user
curl -H "Authorization: Bearer <STOLEN_TOKEN>" https://api.example.com/me
// GET /api/captcha returns the code in response!
{
"success": true,
"captcha_image": "data:image/png;base64,iVBORw0KGgo...",
"captcha_code": "HQXX1" // EXPOSED IN RESPONSE!
}
// Attack: Automated brute force
CAPTCHA=$(curl -s "/api/captcha" | jq -r '.captcha_code')
curl -X POST "/api/login" -d "[email protected]&password=guess&captcha=$CAPTCHA"
// Store code server-side only
public function getCaptcha(Request $request)
{
$code = strtoupper(Str::random(5));
session(['captcha_code' => $code]);
$image = $this->generateCaptchaImage($code);
return response()->json([
'success' => true,
'captcha_image' => $image,
// DO NOT return captcha_code!
]);
}
public function validateCaptcha(Request $request): bool
{
$submitted = $request->input('captcha_code');
$stored = session('captcha_code');
session()->forget('captcha_code'); // Single use
return hash_equals($stored, strtoupper($submitted));
}
// Header allows bypassing encryption requirement
if ($request->header('X-Disable-Encryption') === '1') {
// Skip encryption validation
return $next($request);
}
Attack:
# Bypass encryption with header
curl -X POST "/api/login" \
-H "X-Disable-Encryption: 1" \
-d '{"email":"test","password":"test"}'
// Only allow in non-production environments
if ($request->header('X-Disable-Encryption') === '1') {
if (app()->environment('production')) {
return response()->json(['error' => 'Encryption required'], 400);
}
Log::warning('Encryption bypassed', ['ip' => $request->ip()]);
}
HTTP/2 200
strict-transport-security: max-age=0 # DISABLED!
access-control-allow-origin: * # Too permissive with credentials
access-control-allow-credentials: true
x-frame-options: [MISSING]
content-security-policy: [MISSING]
// app/Http/Middleware/SecurityHeaders.php
public function handle($request, Closure $next)
{
$response = $next($request);
return $response
->header('Strict-Transport-Security', 'max-age=31536000; includeSubDomains')
->header('X-Frame-Options', 'DENY')
->header('X-Content-Type-Options', 'nosniff')
->header('X-XSS-Protection', '1; mode=block')
->header('Content-Security-Policy', "default-src 'self'")
->header('Referrer-Policy', 'strict-origin-when-cross-origin');
}
- [ ] Object IDs validated against user's permissions
- [ ] No direct object reference via URL parameters
- [ ] Authorization checked on every object access
- [ ] UUIDs used instead of sequential IDs
- [ ] Strong password requirements enforced
- [ ] Brute force protection implemented
- [ ] Session tokens are secure and rotated
- [ ] CAPTCHA not bypassable
- [ ] Password hashes never exposed
- [ ] API Resources limit exposed fields
- [ ] Sensitive fields explicitly excluded
- [ ] Mass assignment protection enabled
- [ ] Hidden attributes in models configured
- [ ] Rate limiting on all endpoints
- [ ] Request size limits configured
- [ ] Pagination enforced on list endpoints
- [ ] Complex query limitations
- [ ] Admin endpoints protected by role
- [ ] Horizontal privilege escalation prevented
- [ ] Function-level permissions validated
# Test for data exposure
curl -s "/api/users" -H "Authorization: Bearer $TOKEN" | jq '.users[0] | keys'
# Check if 'pass', 'token', 'reset_token' are present
# Test for IDOR
curl -s "/api/vendors?org_id=2" -H "Authorization: Bearer $TOKEN_ORG_1"
# Should return 403, not org_id=2 data
# Test CAPTCHA bypass
CAPTCHA=$(curl -s "/api/captcha" | jq -r '.captcha_code')
echo "Captcha code exposed: $CAPTCHA"
# Test encryption bypass
curl -X POST "/api/login" -H "X-Disable-Encryption: 1" -d '{"email":"test"}'
# Should be rejected in production
# Check security headers
curl -sI "/api/health" | grep -E "^(strict-transport|x-frame|content-security)"
<?php
namespace App\Http\Controllers\Api;
use App\Http\Resources\VendorResource;
use App\Models\Vendor;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
class VendorController extends Controller
{
public function __construct()
{
$this->middleware('auth:api');
$this->middleware('throttle:60,1');
}
public function index(Request $request): AnonymousResourceCollection
{
// org_id from authenticated user, not request
$orgId = auth()->user()->org_id;
$vendors = Vendor::where('org_id', $orgId)
->paginate($request->input('per_page', 15));
// Use Resource to limit exposed fields
return VendorResource::collection($vendors);
}
public function show(Vendor $vendor): VendorResource
{
// Policy-based authorization
$this->authorize('view', $vendor);
return new VendorResource($vendor);
}
public function store(Request $request): VendorResource
{
$validated = $request->validate([
'name' => 'required|string|max:255',
'email' => 'required|email',
// Whitelist allowed fields only
]);
// org_id set from auth, not input
$validated['org_id'] = auth()->user()->org_id;
$vendor = Vendor::create($validated);
return new VendorResource($vendor);
}
}
class VendorResource extends JsonResource
{
public function toArray($request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'email' => $this->email,
'status' => $this->status,
'created_at' => $this->created_at->toISOString(),
// Internal fields excluded
];
}
}
After audit, provide:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job