T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/authorize.py:34- Finding
Overprivileged Device Authorization and Unrestricted MCP Tool Dispatch
- Content
View full analysis
Vulnerability Details
File Location:
scripts/authorize.py:34-36;scripts/mcp_client.py:1463-1481
Vulnerability Type: Excessive authorization scopes and missing tool allowlist
Risk Level: HighVulnerable 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" )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 Skill functionality is multilingual text-to-speech production. It reasonably requires speech synthesis, voice discovery, and limited task and artifact access. The requested authorization additionally grants image, video, and music generation; voice writing; general artifact writing; wallet spending; and task cancellation.
The command-line client compounds this excessive authorization by accepting any MCP tool name supplied as an argument. It does not enforce a package-specific allowlist. Consequently, the local client can use every operation exposed to the broadly scoped bearer token rather than only operations needed by this Skill.
This violates least privilege. The broad token is sha ...[truncated 1153 chars]
- Remediation
View remediation
Remediation Suggestions
- Issue a package-specific token limited to speech synthesis, voice reading, and the minimum task and artifact operations required to retrieve results.
- Remove
images:generate,videos:generate,music:generate,voices:write, broadartifacts:write, and wallet permissions unless a concrete Skill operation requires them. - Implement a local immutable allowlist of accepted MCP tools, such as the exact speech, voice-discovery, task-status, and cancellation operations documented by the Skill.
- Reject unknown tool names before initializing a remote session.
- Separate billable and non-billable tools and require explicit user authorization before every newly introduced category of paid operation.
- Avoid sharing a full-scope credential between unrelated Skill packages.
