T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/authorize.py:34- Finding
Overprivileged Device Token and Unrestricted MCP Tool Invocation
- Content
View full analysis
Vulnerability Details
File Location:
scripts/authorize.py:34-37;scripts/mcp_client.py:1463-1481;scripts/mcp_client.py:1490-1497
Vulnerability Type: Violation of least privilege and unrestricted remote tool dispatch
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}, )python call = subparsers.add_parser("call", help="Call one tool with a JSON object on stdin") call.add_argument("tool_name")Technical Analysis
The declared purpose of this Skill is to create WeChat article image packs. Its legitimate operations require image generation, image transformation, image editing, asset upload, model discovery, and limited task retrieval or cancellation.
The authorization request nevertheless includes unrelated privileges for video generation, music generation, speech generation, voice reading and writing, general artifact access, task cancellation, and wallet spending. The bundled client also accepts any MCP tool name supplied on the ...[truncated 1707 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the broad scope with the minimum capabilities required for this image-specific Skill.
- Remove video, music, speech, voice-write, and other unrelated permissions.
- Reassess whether general
wallet:spendis necessary or whether paid image operations can use a narrower image-billing permission. - Add a strict local allowlist before dispatching
tools/call. It should contain only:beatra.models.listbeatra.assets.uploadbeatra.images.generatebeatra.images.transformbeatra.images.editbeatra.tasks.getbeatra.tasks.listbeatra.tasks.cancel, only following an explicit user requestbeatra.installations.register, if telemetry remains enabled
- Reject unknown tool names before creating an authenticated MCP request.
- Where supported, use separate credentials per package or capability instead of one shared full-scope token.
- Require explicit confirmation immediately before every billable or destructive operation.
