T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- agents/openai.yaml:6
- Finding
- Full-Catalog MCP Endpoint Violates Least-Privilege Requirements## Vulnerability Details **File Location**: `agents/openai.yaml:6-11` **Vulnerability Type**: Excessive MCP tool privileges **Risk Level**: Medium ### Vulnerable Code ```yaml dependencies: tools: - type: "mcp" value: "mermail" description: "Mermail workspace and mailbox MCP server" transport: "streamable_http" url: "https://console.mermail.app/mcp" ``` ### Technical Analysis The agent configuration connects to Mermail's unrestricted `/mcp` endpoint. According to `references/tools.md`, that endpoint exposes the full tool catalog, whereas the dedicated `/mcp?profile=agent-inbox` endpoint exposes only the 12 operations required for mailbox discovery, provisioning, and bounded email inspection. This configuration conflicts with the Skill's own least-privilege design. Although the instructions tell the model to self-restrict its tool usage, an instruction-level restriction is weaker than server-side tool exclusion. Tool-selection errors, prompt injection from untrusted email, or failures in host enforcement could therefore reach unrelated operations in the full Mermail catalog. ### Attack Path 1. The host loads the Skill and establishes the configured connection to `https://console.mermail.app/mcp`. 2. The unrestricted endpoint makes the full Mermail tool catalog available to the agent. 3. The agent processes attacker-controlled email metadata or content during the inbox workflow. 4. Prompt injection, model error, or inadequate host isolation influences tool selection. 5. The agent invokes an unrelated full-catalog operation that would not have been exposed by the dedicated `agent-inbox` profile. This path depends on a tool-selection or policy-enforcement failure; the project otherwise contains explicit instructions to treat inbound email as untrusted. ### Impact Assessment The agent could exercise Mermail capabilities beyond the legitimate requirements of creating or reusing a ...[truncated 488 chars]
- Remediation
- ## Remediation Suggestions 1. Replace the full-catalog URL with the dedicated least-privilege profile: ```yaml dependencies: tools: - type: "mcp" value: "mermail" description: "Mermail workspace and mailbox MCP server" transport: "streamable_http" url: "https://console.mermail.app/mcp?profile=agent-inbox" ``` 2. Enforce a host-side allowlist containing only the 12 documented tools: - `get_api_credit_usage` - `list_workspaces` - `get_workspace` - `list_email_domains` - `list_workspace_mailboxes` - `list_mailboxes` - `create_mailbox` - `get_mailbox` - `list_emails` - `search_emails` - `get_email` - `get_email_context` 3. Do not rely exclusively on natural-language instructions to prevent access to unrelated tools. Apply the restriction at both the server profile and host authorization layers. 4. Add a configuration test that fails if the packaged agent endpoint is `/mcp` without the `profile=agent-inbox` query parameter. 5. Retain the existing safeguards for scan-gated reads, bounded content, prompt-injection handling, and fresh approval before using OTPs or magic links.
