T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- scripts/authorize.py:34
- Finding
- Overprivileged Shared Bearer Token Exceeds the Skill's Functional Requirements<![CDATA[ ## Vulnerability Details **File Location**: `scripts/authorize.py:34-37` **Vulnerability Type**: Excessive OAuth/MCP authorization scope **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 declared Skill functionality is limited to creating and editing project-handover sign images, uploading optional visual references, reading model and wallet information, and managing related asynchronous tasks. The requested authorization scope additionally permits: - Video generation - Music generation - Speech generation - Voice reading and modification - General artifact access - Account credit spending - Task cancellation These privileges are unrelated to the narrow image-sign workflow. The authorization documentation also states that this is a single full-scope Device Token shared by all installed Beatra Skills. Consequently, compromise of one credential or one package exposes capabilities beyond this Skill's legitimate requirements. The token is stored at `~/.beatra/credentials.json` and is accepted as a bearer credential. Possession is therefore sufficient to exercise the granted server-side permissions. ### Attack Path 1. An attacker obtains local read access to `~/.beatra/credentials.json`, compromises a package update, or exploits another process running as the user. 2. The attacker extracts the `access_token`. 3. The attacker authenticates to `https://mcp.beatra.ai/mcp` using the bearer token. 4. The attacker invokes unrelated scoped operations such as music, video, speech, or voice operations. 5. Where supported by the service, the attacker spends credits, accesses artifacts, or cancels tasks without needing another authorization decision. ### Impact Assessment A compromised credential can potentially provide access to unrel ...[truncated 382 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Define a package-specific least-privilege scope containing only the operations required by this Skill. 2. Remove `videos:generate`, `music:generate`, `speech:generate`, and `voices:write`. 3. Restrict artifact and task permissions to resources created by this package where the backend supports resource-level authorization. 4. Separate credit-spending authorization from read-only wallet access. 5. Avoid sharing one unrestricted bearer token across unrelated Skills. Use per-Skill credentials or delegated tokens with audience, capability, and package restrictions. 6. Display the exact requested capabilities on the device-authorization approval page. 7. Support token rotation and immediate revocation, and record auditable per-package attribution on the server. ]]>
