T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- scripts/authorize.py:30
- Finding
- Overprivileged Shared Device Authorization Token<![CDATA[ ## Vulnerability Details **File Location**: `scripts/authorize.py:30-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's documented workflow requires uploading selected media, generating speech, optionally cloning a voice, generating videos, discovering models, and reading relevant task results. The authorization request nevertheless asks for additional capabilities such as: - `images:generate` - `music:generate` - Broad `artifacts:read` - Broad `tasks:cancel` - General `wallet:spend` These permissions exceed the minimum privileges necessary for the declared fund-dividend talking-clip workflow. The resulting bearer credential is also shared among installed Beatra Skills through `~/.beatra/credentials.json`, increasing the impact of any compromised or malicious package with access to that credential. Although the Skill includes user-confirmation instructions before paid operations, these are agent-level procedural controls rather than enforcement at the credential or API authorization layer. Code possessing the token can bypass those instructions and invoke any granted operation directly. ### Attack Path 1. A malicious or compromised local process, Skill update, or other Beatra package gains execution under the same user. 2. It reads the shared bearer token from `~/.beatra/credentials.json`. 3. It sends authenticated requests to the fixed Beatra MCP endpoint. 4. It invokes unrelated capabilities covered by the broad scope, such as music or image generation, artifact access, task cancellation, or credit-consuming operations. 5. The requests execute under the victim's Beatra account because the server sees a valid full-scope token. ### ...[truncated 592 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Define a least-privilege scope specifically for this Skill. 2. Remove unrelated scopes such as `images:generate` and `music:generate`. 3. Restrict artifact access to artifacts created or explicitly selected for this workflow. 4. Restrict task cancellation to tasks created by the current package and installation. 5. Replace general wallet spending authority with server-enforced per-operation authorization. 6. Use package-specific credentials rather than one full-scope credential shared by every Beatra Skill. 7. Enforce paid-operation approval on the server side with short-lived, operation-specific grants. 8. Add automated tests that compare requested scopes against the capabilities declared in the Skill manifest. ]]>
