T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- scripts/authorize.py:31
- Finding
- Device authorization requests privileges unrelated to the declared Skill functionality<![CDATA[ ## Vulnerability Details **File Location**: `scripts/authorize.py:31-34` **Vulnerability Type**: Excessive OAuth scopes 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 declares a workflow for reading public TikTok posts and comments, uploading operator-selected assets, generating image cards, checking models and wallet information, and monitoring resulting tasks. The authorization scope is substantially broader than those requirements. It includes video generation, music generation, speech generation, voice creation, general wallet spending, and task cancellation. These capabilities are not necessary for the declared quote-card workflow. The resulting Device Token is shared across Beatra Skills and remains usable while active. Consequently, compromise or misuse of this token would grant access to unrelated paid and state-changing operations rather than only the minimum operations required by this package. ### Attack Path 1. The user runs `scripts/authorize.py`. 2. The authorization request asks the user to approve the complete scope string. 3. Beatra returns a bearer token containing the broad approved permissions. 4. The token is stored in `~/.beatra/credentials.json`. 5. A malicious instruction, compromised package update, or local process able to access the token invokes unrelated video, music, speech, voice, spending, or cancellation operations. 6. Those operations execute under the user's Beatra account despite being outside the declared purpose of this Skill. ### Impact Assessment An attacker who gains use of the credential can potentially: - Spend account credits on image, video, music, and speech operations. - Create or modify voice resources. - Read artifacts and tasks asso ...[truncated 286 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Define a package-specific least-privilege scope containing only the operations needed for: - TikTok video and comment lookup. - Asset upload. - Text-to-image model discovery and generation. - Task reads. - Read-only wallet and billing access, if required. 2. Remove video, music, speech, voice-write, and task-cancellation scopes unless a documented workflow explicitly requires them. 3. Separate read-only, billable, and administrative capabilities into different tokens or grants. 4. Display the exact requested capabilities to the user before opening the authorization page. 5. Avoid sharing a full-scope token between unrelated Skills. Prefer package-bound credentials enforced by the server. 6. Add server-side authorization policies that reject tools outside the package's registered allowlist, even if a broader token is presented. ]]>
