T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- scripts/authorize.py:31
- Finding
- Overprivileged Device Authorization and Unrestricted MCP Tool Dispatch<![CDATA[ ## Vulnerability Details **File Location**: `scripts/authorize.py:31-34`; `scripts/mcp_client.py:1469-1489` **Vulnerability Type**: Excessive authorization scope and insufficient client-side tool restriction **Risk Level**: High ### Complete Code Snippets Authorization requests capabilities beyond those required for insurance-renewal talking clips: ```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 generic command interface accepts an arbitrary MCP tool name and forwards it without a local allowlist: ```python def _run_command(command: str, tool_name: str | None = None) -> dict[str, Any]: session = _session_with_registration( state_dir=Path.home() / ".beatra", post_json=_default_post_json, ) if command == "tools": return session.request(2, "tools/list", {}) try: arguments = json.load(os.sys.stdin) except json.JSONDecodeError as exc: raise RuntimeError("Tool arguments on stdin must be one JSON object") from exc if not isinstance(arguments, dict): raise RuntimeError("Tool arguments on stdin must be one JSON object") assert tool_name is not None return session.request( 2, "tools/call", {"name": tool_name, "arguments": arguments}, ) ``` ### Technical Analysis The declared workflow needs asset upload, model and voice discovery, optional voice cloning, speech synthesis, image-to-video generation, task inspection, and limited billing queries. The authorization scope additionally grants generic image generation, music generation, broad artifact access, task cancellation, and wallet spending. The client also exposes a generic `call` command that forwards any supplied MCP tool name. It does not enforce an allowlist matching the Skill's documented workflow. Authorization is still enforced by th ...[truncated 1600 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the shared full-scope token with a package-specific, least-privilege authorization grant. 2. Remove capabilities not required by this Skill, particularly generic music generation, generic image generation, broad artifact reading, and unrestricted cancellation. 3. Add a local allowlist for accepted MCP tools. The allowlist should contain only the documented upload, model, voice, speech, video, task, wallet-read, and installation-registration operations. 4. Reject unknown tool names before opening an authenticated session. 5. Separate read-only, generation, cancellation, and wallet-spending privileges where supported. 6. Require an explicit user confirmation immediately before cancellation and every billable operation. 7. Have the server independently bind the credential to the package identity and enforce a server-side tool allowlist; client-side restrictions alone are not a sufficient security boundary. 8. Display the exact requested scopes during authorization so the user can make an informed decision. ]]>
