T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- src/engine.ts:101
- Finding
- Configured allowlists are bypassed for essential and T0 tools<![CDATA[ ## Vulnerability Details **File Location**: `src/engine.ts:101-110` **Vulnerability Type**: Authorization bypass and excessive tool privileges **Risk Level**: High ### Vulnerable Code ```ts // 4. Essential tool + T0 early exit — bypass allowlist and escalation. // Control-plane tools (message, gateway, session_status, etc.) and // read-only T0 tools must NEVER be blocked by allowlists or escalation // counters. Without this, the agent bricks itself when it hits // maxBlockedRetries — same deadlock class as the dry-run issue. // Deny patterns (step 3) still apply to prevent abuse. if (this.isEssentialTool(name) || isT0(name, this.config.riskTiers)) { return { action: "allow", tier, reason: "Essential/T0 tool — always allowed" }; } ``` The default exempted tools are defined in `src/config.ts:29-36`: ```ts const DEFAULT_ESSENTIAL_TOOLS: string[] = [ "message", "gateway", "session_status", "sessions_send", "sessions_list", "tts", ]; ``` ### Technical Analysis The early return occurs before allowlist enforcement in normal enforcement mode. It therefore grants unconditional access to every tool classified as T0 and every tool in `dryRunEssentialTools`, even if the applicable agent profile deliberately omits that tool. The exemption includes sensitive control-plane and externally effective capabilities such as `gateway`, `sessions_send`, and `message`. T0 also includes tools such as `memory_get`, `memory_search`, and `web_fetch`. Although some of these are described as read-only, they can still expose sensitive information or communicate with external systems. Deadlock prevention can justify a narrowly constrained recovery channel, but it does not justify bypassing administrator-defined allowlists during ordinary operation. The implementation conflicts with the declared per-agent allowlist functionality and violates least privilege. ### Attack Path 1. An administrator assigns an untrusted agent a restrictive tool profile ...[truncated 932 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Enforce the applicable agent allowlist before applying any essential or T0 exception during normal operation. 2. Restrict deadlock exemptions to an explicitly activated recovery state rather than applying them globally. 3. Remove powerful tools such as `gateway` and `sessions_send` from unconditional defaults. 4. Require operator authentication or a separately protected capability for gateway configuration changes. 5. Define a minimal immutable recovery set containing only operations that cannot modify configuration, contact external destinations, or access sensitive memory. 6. Add regression tests proving that an agent profile can deny every T0 and control-plane tool. 7. Document any unavoidable exemptions clearly so administrators do not assume that allowlists are authoritative for those tools. ]]>
