T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/authorize.py:33- Finding
Overprivileged Device Token and Unrestricted MCP Tool Invocation
- Content
View full analysis
Vulnerability Details
File Location:
scripts/authorize.py:33-37; related invocation logic atscripts/mcp_client.py:1450-1466
Vulnerability Type: T05: Unauthorized Access and Privilege Escalation
Risk Level: HighComplete Code Snippets
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 bundled client also accepts an arbitrary MCP tool name rather than enforcing a Skill-specific 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 Skill's declared purpose is to create resident-event still images. Its legitimate operations include image generation and editing, optional artifact upload, model discovery, task inspection or cancellation, and billing inspection.
The authorization scope nevertheless includes unrelated capabilities for video generation, music generation, speech generation, and voice creation or modification. It also grants the general
wallet:spendpermission. These permissions materially exceed what is required for the declared image-pack workflow.This overbroad authorization is compounded by the generic
callinterface, which passes any su ...[truncated 2164 chars]- Remediation
View remediation
Remediation Suggestions
- Request only the scopes required by this Skill, such as image generation or editing, required artifact operations, model discovery, narrowly scoped task access, and necessary billing operations.
- Remove video, music, speech, and voice-write scopes unless a documented resident-event workflow genuinely requires them.
- Replace generic wallet spending authority with a narrower image-specific billing permission if the service supports one.
- Add a local allowlist in
mcp_client.pyfor the precise tools used by this package. Reject every unrecognized tool before establishing or sending an MCP request. - Use a separate package-specific credential rather than a shared full-scope Device Token where backend architecture permits.
- Add server-side package-to-tool authorization so
source_package_slugis enforced rather than treated only as telemetry. - Clearly show the requested capabilities on the authorization page and require renewed approval whenever privileges expand.
