/viperclaw:viper-bola-idorfrom viperclaw
Audits API endpoints and controllers for BOLA, IDOR, and BFLA vulnerabilities. Reviews resource access controls, tenant scoping, and ownership checks using static analysis and a structured checklist.
Ships in viperclaw. 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.
viper-bola-idor)viper_diff_oracle, viper_taint_scan, viper_graph_upsert, viper_verify_and_reportviperclaw taint ./src --db .viperclaw/graph.dbflowchart LR
Caller["Authenticated Caller (User A, Tenant 1)"] --> Ctrl["API Controller (/orders/{id})"] --> AuthZ["Policy / Ownership Check"] --> DB[("Database (WHERE id = ? AND tenant_id = ?)")]
Controllers validate authentication (verifying the caller has a valid JWT/session) but query the database using only the client-supplied resource ID (WHERE id = :id) without binding the caller's user_id or tenant_id.
Run the following discovery commands across the target repository before manual code review:
# 1. Automated ViperClaw analysis
viperclaw taint ./src --db .viperclaw/graph.db
# 2. Rapid static pattern discovery (ripgrep)
rg -n "\.(findById|find_by_id|get_object_or_404|findUnique|findOne)\("
rg -n "WHERE\s+id\s*=\s*(\?|%s|\$1|:id)"
rg -n "/api/v[0-9]+/[a-zA-Z0-9_-]+/\{?(id|uuid|user_id|org_id|account_id)\}?"
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
BOLA-01 | Query-Level Ownership Binding | Every SELECT/UPDATE/DELETE query includes AND tenant_id = :ctx_tenant AND user_id = :ctx_user. | Resource fetched solely by primary key findById(req.params.id) without ownership check. |
BOLA-02 | Nested & Sub-Resource Scoping | Child resources (/orgs/{org_id}/projects/{proj_id}/keys/{key_id}) verify parent-child hierarchy. | Controller checks org_id membership but looks up key_id globally without verifying key.org_id == org_id. |
BOLA-03 | Bulk & Array Endpoint Authorization | Batch endpoints (POST /api/items/bulk-delete with ids: [1,2,3]) verify ownership of every ID in the array. | Controller checks ownership of ids[0] only and deletes the entire WHERE id IN (...) list. |
BOLA-04 | Function-Level RBAC (BFLA) | Administrative routes (/admin/*, DELETE, role-assignment) enforce explicit server-side role guards. | Admin endpoints rely on UI hiding or only check standard user authentication. |
BOLA-05 | Foreign-Key Reference Validation on Create/Update | Creating a resource with project_id or folder_id in the body verifies the caller owns that target container. | A caller creates a webhook or export bound to another tenant's project_id. |
BOLA-06 | UUIDv4 vs. Access Control | Unpredictable UUIDs are paired with server-side ownership checks (UUIDs alone are not authorization). | Publicly readable/writable objects protected solely by unauthenticated UUIDs leaked in logs/referrers. |
BOLA-07 | GraphQL & gRPC Resolver AuthZ | Every nested GraphQL field resolver and gRPC handler enforces context-based policy checks. | Top-level query checks auth, but nested edge { organization(id: "other") { billing } } skips auth. |
BOLA-08 | Export & Async Job Ownership | Async report generation (POST /reports -> GET /reports/{job_id}) binds job_id to caller's session. | Sequential job_id downloadable by any authenticated user. |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.1) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | Unauthenticated BOLA/BFLA allowing read/write of arbitrary tenant accounts or API keys. |
| HIGH (8.1) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N | Authenticated cross-tenant read/modify of private records, invoices, or user profiles. |
| MEDIUM (6.5) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N | Authenticated horizontal read-only access to non-credential user metadata. |
# ❌ VULNERABLE: Fetches invoice by ID alone; any logged-in user can read any tenant's invoice
@router.get("/invoices/{invoice_id}")
async def get_invoice(invoice_id: int, current_user: User = Depends(get_current_user), db: Session = Depends(get_db)):
invoice = db.query(Invoice).filter(Invoice.id == invoice_id).first()
if not invoice:
raise HTTPException(status_code=404)
return invoice
# ✅ HARDENED: Scopes query directly to authenticated user's tenant_id & verifies role
@router.get("/invoices/{invoice_id}", response_model=InvoiceReadDTO)
async def get_invoice(invoice_id: int, current_user: User = Depends(get_current_user), db: Session = Depends(get_db)):
invoice = (
db.query(Invoice)
.filter(Invoice.id == invoice_id, Invoice.tenant_id == current_user.tenant_id)
.first()
)
if not invoice:
raise HTTPException(status_code=404, detail="Invoice not found")
return invoice
viperclaw taint and viperclaw verify to confirm zero remaining unmitigated flows in .viperclaw/graph.db.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas.Other plugins' skills for the same job