T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/authorize.py:31- Finding
Excessive authorization scopes combined with unrestricted remote-tool dispatch
- Content
View full analysis
Vulnerability Details
File Location:
scripts/authorize.py:31-35,scripts/mcp_client.py:1462-1480,scripts/mcp_client.py:1484-1485
Vulnerability Type: Excessive privileges and unrestricted remote tool invocation
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 Skill functionality requires image generation and editing, artifact upload, model discovery, task management, and a limited set of optional Xiaohongshu research operations. The authorization request nevertheless obtains permissions for unrelated functionality, including video generation, music generation, speech generation, voice read/write access, and wallet spending.
The bundled CLI compounds this excessive authorization by accepting an unrestricted
tool_name. It performs no local allowlist check before forwa ...[truncated 1595 chars]- Remediation
View remediation
Remediation Suggestions
- Reduce the Device Authorization scope to the minimum operations required by this Skill. Remove video, music, speech, voice-write, and other unrelated permissions.
- Avoid granting
wallet:spendas a general scope where narrower operation-specific spending authorization is available. - Add a fixed local tool allowlist containing only documented operations, such as:
beatra.models.listbeatra.images.generatebeatra.images.transformbeatra.images.editbeatra.assets.upload- Required task list/get/cancel operations
- Installation registration
- The explicitly documented Xiaohongshu lookup operations
- Reject every tool name not present in that allowlist before initializing or contacting the remote service.
- Separate optional social research and paid-operation permissions into explicit, purpose-specific grants.
- Add tests proving that unrelated media, voice, wallet, and administrative tools cannot be invoked through the packaged client.
