T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- scripts/authorize.py:33
- Finding
- Authorization Token Grants Capabilities Beyond the Skill's Functional Requirements<![CDATA[ ## Vulnerability Details **File Location**: `scripts/authorize.py:33-37` **Vulnerability Type**: Excessive authorization scope and violation of least privilege **Risk Level**: Medium ### Vulnerable 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" ) ``` ### Technical Analysis The Skill's declared purpose is to upload authorized media, optionally clone a voice, synthesize speech, and produce image-to-video geography clips. It therefore legitimately requires access to artifacts, speech generation, voice operations, video generation, model or tool discovery, and task status operations. However, the requested Device Token also grants unrelated capabilities, including: - `images:generate` - `music:generate` - General `wallet:spend` - Broad artifact and task access - General task cancellation Image generation and music generation are not required by the documented geography talking-clip workflow. Moreover, the token is shared across installed Beatra Skills rather than being restricted to this package and its resources. This increases the authorization boundary substantially beyond the minimum privileges needed by the Skill. The credential-file access itself is legitimate and appropriately protected on POSIX systems. The issue is the breadth of the server-side permissions represented by the token, not the fact that the client reads it. ### Attack Path 1. An attacker obtains code execution in this Skill, a future remotely installed version of it, or another local component able to read the shared credential. 2. The attacker reads the full-scope bearer token from `~/.beatra/credentials.json`. 3. The attacker sends authenticated requests to `https://mcp.beatra.ai/mcp`. 4. The token is used to perform operations outside this Skill's declared workflow, such as image generation, music generation, wallet ...[truncated 746 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Issue a package-specific token rather than reusing one full-scope Device Token across all Beatra Skills. 2. Remove capabilities unrelated to this workflow, particularly: - `images:generate` - `music:generate` 3. Restrict `wallet:spend` to approved operations, package identities, and user-confirmed request IDs. 4. Scope artifact and task access to resources created by this package or the current workflow. 5. Restrict task cancellation to tasks created by this package. 6. Request additional permissions through explicit incremental authorization only when a user selects a feature that requires them. 7. Display the exact requested capabilities on the device-authorization page so the user can make an informed decision. 8. Add automated tests that compare the authorization scope against the MCP tools actually invoked by the Skill. ]]>
