T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- scripts/authorize.py:33
- Finding
- Shared Device Token Requests Permissions Beyond the Skill's Functional Requirements## Vulnerability Details **File Location**: `scripts/authorize.py:33-37` **Vulnerability Type**: Excessive OAuth authorization scope **Risk Level**: Medium ```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 authorization helper requests a shared, full-scope Device Token. The declared listing-video workflow requires image and video generation, optional speech generation, catalog voice reads, artifact operations, wallet spending, and task management. It does not declare any need to generate music or modify voice resources. The `music:generate` and `voices:write` permissions therefore exceed the minimum privileges necessary for this Skill. Because the credential is shared by installed Beatra Skills and the bundled MCP client can call a tool whose name is supplied on the command line, unnecessary scopes increase the consequences of token theft, another compromised Skill, or unauthorized local invocation. ### Attack Path 1. An attacker obtains access to `~/.beatra/credentials.json`, compromises another component that shares the Device Token, or gains the ability to invoke the bundled MCP client as the user. 2. The attacker submits an MCP tool call unrelated to the listing-room workflow, such as a music-generation or voice-modification operation. 3. The Beatra service accepts the operation because the shared token includes `music:generate` or `voices:write`. 4. The attacker consumes account credits or modifies voice-related resources beyond this Skill's legitimate scope. ### Impact Assessment Successful exploitation could permit unrelated billable music generation and modification of voice resources. The exposure is limited to the permissions granted by the Beatra Device Token; no evidence indicates local operating-system privilege escalation. N ...[truncated 156 chars]
- Remediation
- ## Remediation Suggestions 1. Remove `music:generate` and `voices:write` from this Skill's requested scope. 2. Derive authorization scopes from the specific package's declared capabilities rather than using a common full-scope token. 3. Prefer a package-specific or capability-limited token instead of sharing one broadly privileged credential across all Beatra Skills. 4. Add a local allowlist in `mcp_client.py` so this package can invoke only the tools required by its documented workflow. 5. Require separate, explicit authorization if a user later requests a capability outside the original grant. 6. Add automated tests that compare requested authorization scopes and callable tools against the Skill's declared functionality.
