T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- scripts/authorize.py:31
- Finding
- Overprivileged Shared Device Credential and Unrestricted MCP Tool Invocation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/authorize.py:31-34`; `scripts/mcp_client.py:1472-1487` **Vulnerability Type**: Excessive authorization scope and unrestricted remote tool selection **Risk Level**: Medium ### Vulnerable Code ```python SCOPE = ( "mcp:tools artifacts:write images:generate videos:generate music:generate " "speech:generate voices:read voices:write wallet:spend tasks:read artifacts:read tasks:cancel" ) ``` The client also accepts an arbitrary MCP tool name: ```python call = subparsers.add_parser("call", help="Call one tool with a JSON object on stdin") call.add_argument("tool_name") ``` The supplied name is passed directly to the remote MCP service: ```python return session.request( 2, "tools/call", {"name": tool_name, "arguments": arguments}, ) ``` ### Technical Analysis The declared purpose of this Skill is voice cloning and recurring speech synthesis. Its legitimate operations require access to voice cloning, speech generation, artifact upload, model discovery, task management, and relevant billing operations. The authorization request also obtains unrelated capabilities, including: - `images:generate` - `videos:generate` - `music:generate` In addition, the generic `call` command accepts any MCP tool name instead of restricting calls to the tools required by this Skill. The combination of a broadly scoped bearer token and unrestricted tool selection violates least-privilege principles. The excessive scopes are disclosed in the documentation as part of a shared full-scope credential, so this is not covert credential acquisition. Nevertheless, disclosure does not eliminate the security impact of granting permissions beyond the task’s legitimate needs. ### Attack Path 1. The user runs `scripts/authorize.py` to authorize the voice-cloning Skill. 2. The authorization server issues a bearer token containing voice, image, video, music, wallet, artifact, and task permissions. 3. The bearer to ...[truncated 1540 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the shared full-scope authorization with a package-specific, least-privilege token. 2. Remove unrelated scopes such as `images:generate`, `videos:generate`, and `music:generate`. 3. Limit the token to the exact operations required for this Skill, such as: - Artifact upload and read access needed for voice samples. - Voice read and clone/write operations. - Speech generation. - Model discovery. - Task read and user-confirmed cancellation. - The minimum wallet permissions required for estimates, spending, balances, and ledgers. 4. Introduce a local allowlist of permitted MCP tool names. Reject any tool outside the voice-cloning workflow before making a network request. 5. Separate credentials by Skill or capability group rather than sharing one full-scope token across unrelated packages. 6. Require explicit user confirmation immediately before invoking any billable tool, even if called through the generic client interface. 7. Add server-side policy enforcement binding the credential to the package slug and permitted tool set. Client-side allowlisting should supplement, not replace, server-side authorization. 8. Record auditable tool invocation metadata without storing prompts, tokens, or sensitive voice content. ]]>
