T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- scripts/authorize.py:31
- Finding
- Overprivileged Shared Device Authorization<![CDATA[ ## Vulnerability Details **File Location**: `scripts/authorize.py:31-35` **Related Documentation**: `references/installation-and-auth.md:73-74`, `references/mcp-connection.md:9-10` **Vulnerability Type**: Excessive OAuth scope and violation of least privilege **Risk Level**: High ### 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 workflow requires image generation, video generation, asset upload, model and task reads, billing reads, and optional task cancellation. However, the device authorization also requests unrelated capabilities: - Music generation - Speech generation - Voice resource reads - Voice resource writes - Broad wallet spending - General MCP tool access These permissions are not necessary to create three still images and one opening-film clip. The documentation also states that this full-scope token is shared among installed Beatra Skills and has a sliding 15-day idle lifetime. The broad authorization substantially increases the consequences of a compromised package, malicious prompt, local process, or other Skill using the same credential. Credential file permissions protect against access by other local users on POSIX systems, but they do not restrict code running as the authorized user. ### Attack Path 1. The user runs `scripts/authorize.py`. 2. The authorization request asks for all permissions in the hardcoded `SCOPE`. 3. Beatra issues a bearer token containing unrelated music, speech, voice, wallet, artifact, and task capabilities. 4. The token is stored in the shared `~/.beatra/credentials.json` file. 5. A compromised Skill process, injected instruction, malicious update, or another process running as the same user invokes an unrelated MCP operation through the shared credential. 6. The remote service acc ...[truncated 715 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the shared full-scope authorization with package-specific, least-privilege credentials. 2. Remove permissions unrelated to this Skill, particularly: - `music:generate` - `speech:generate` - `voices:read` - `voices:write` 3. Replace broad `wallet:spend` access with image- and video-specific spending authorization if the service supports granular scopes. 4. Separate read-only operations from billable and state-changing operations. 5. Avoid sharing one high-privilege token among unrelated Skills. Use per-package credentials or server-enforced package capability policies. 6. Clearly display the requested permissions on the device approval page so the user can make an informed decision. 7. Add automated tests that compare the requested scopes against an explicit list of capabilities required by the declared workflow. ]]>
