red-team
Adversarial security sweep for Alder Grove — TenantTx bypass, cross-workspace IDOR, Clerk JWT tampering, ACP session hijacking, gate bypass, CRDT tampering
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Adversarial security sweep for Alder Grove — TenantTx bypass, cross-workspace IDOR, Clerk JWT tampering, ACP session hijacking, gate bypass, CRDT tampering
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Scaffold a REST API endpoint with hexagonal layers and integration tests
Scaffold a React component with Vitest tests (TDD-first)
Scaffold a new Shell extension with hexagonal layers and TDD
Add a sub-feature within an existing Shell extension
Scaffold a SQL migration with RLS policy, rollback plan, and test seed data
Scaffold a Tauri IPC command with full round-trip (Rust handler, TS types, React hook, tests)
| name | red-team |
| description | Adversarial security sweep for Alder Grove — TenantTx bypass, cross-workspace IDOR, Clerk JWT tampering, ACP session hijacking, gate bypass, CRDT tampering |
| user_invocable | true |
Adversarial security sweep targeting Alder Grove's multi-tenant isolation, authentication, and authorization boundaries.
Accepts optional scope via $ARGUMENTS:
| Invocation | Scope |
|---|---|
/red-team | Full sweep — all 8 vectors |
/red-team rls | Row-level security only (vectors 1-3) |
/red-team acp | Agent Communication Protocol only (vectors 5-7) |
/red-team auth | Clerk JWT + route auth only (vectors 4, 8) |
Inspect the database schema for row-level security posture:
crates/grove-api/src/db/ for CREATE POLICY, ALTER TABLE ... ENABLE ROW LEVEL SECURITY, and SET LOCAL GUC statementsapp.current_workspace_id)Enumerate all route handlers and their auth middleware:
crates/grove-api/src/routes/ for all route definitions (.route(), .get(), .post(), .put(), .patch(), .delete())Audit how tenant identity flows from JWT to query:
crates/grove-api/src/extract.rs for JWT claim extractionorg_id and workspace_id are sourced (path params, JWT claims, headers)resolve_workspace() for ownership verificationFor each vector: define negative control (expected rejection), exploit attempt, and proof of success/failure. Skip vectors outside the requested scope.
Target: TenantTx wrapper in crates/grove-api/src/db/tenant.rs
TenantTx only return rows for the set workspaceapp.current_workspace_id GUC mid-transaction? Can a query bypass TenantTx by using the raw pool directly?TenantTx. Search for any SET LOCAL or RESET of the GUC outside the TenantTx setup pathTarget: All entity CRUD routes
SELECT queries for missing workspace_id WHERE clauses. Check if UUID-based lookups include workspace scopingTarget: app.current_workspace_id GUC lifecycle
SET LOCAL statement from user input. Check after_release pool hook resets GUCTarget: JWT validation in auth middleware
alg: none? Does it validate the issuer (iss) and audience (aud)? Does it check token expiration? Is the JWKS endpoint pinned or could a self-signed key be injected?Target: WebSocket ACP connections
Target: Gate approval endpoints
Target: Collaborative document sync via Yrs
Target: All API routes
/health) without authMap trigger vulnerabilities to derived attacks:
| Trigger (if exploited) | Derived Attack |
|---|---|
| TenantTx bypass (V1) | Cross-workspace data exfiltration |
| Cross-workspace IDOR (V2) | Entity enumeration, data theft |
| GUC injection (V3) | Arbitrary workspace impersonation |
| JWT tampering (V4) | Full account takeover, org escalation |
| ACP session hijack (V5) | Agent impersonation, unauthorized code execution |
| Gate bypass (V6) | Skip approval checkpoints, unsafe deployments |
| CRDT tampering (V7) | Document corruption, injected content |
| Missing auth (V8) | Unauthenticated access to any unprotected route |
| V3 + V1 | Full tenant isolation bypass |
| V4 + V5 | Authenticated agent session hijacking |
| V8 + V2 | Unauthenticated cross-workspace IDOR |
=== ALDER GROVE RED TEAM REPORT ===
Scope: [full | rls | acp | auth]
Date: YYYY-MM-DD
--- Phase 1: Recon Summary ---
Tables with RLS: [count] / [total]
Routes with auth: [count] / [total]
JWT validation: [Clerk SDK | custom | mixed]
--- Phase 2: Findings ---
[CONFIRMED | LIKELY | INFORMATIONAL] V<N>: <Title>
Confidence: <0-100>%
Evidence: <file:line — what was found>
Impact: <what an attacker could do>
Negative control: [PASSED | FAILED — explanation]
Remediation: <specific fix>
... (repeat for each vector tested) ...
--- Phase 3: Chain Paths ---
<trigger> -> <derived> : [CONFIRMED | LIKELY | INFORMATIONAL]
--- Summary ---
Confirmed (>=80%): [count]
Likely (>=50%): [count]
Informational: [count]
Negative controls passed: [count] / [total]
Residual risks: [list of accepted risks or areas needing manual review]
=== END REPORT ===