T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- scripts/authorize.py:30
- Finding
- Overprivileged Shared Device Credential Exceeds the Skill's Functional Requirements<![CDATA[ ## Vulnerability Details **File Location**: `scripts/authorize.py:30-34` **Vulnerability Type**: Excessive authorization scope and shared bearer credential **Risk Level**: High ### Evidence ```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" ) ``` The broad scope is subsequently required when validating an existing credential: ```python if ( not isinstance(value, dict) or value.get("schema_version") != 1 or value.get("mcp_url") != MCP_URL or value.get("token_type") != "Bearer" or any(not isinstance(value.get(name), str) or not value[name] for name in required_strings) or set(value["scope"].split()) != set(SCOPE.split()) ): return None ``` Documentation confirms that this is a shared, full-scope token: ```text They share the one full-scope Device Token stored in ~/.beatra/credentials.json. ``` ### Technical Analysis The declared functionality is the creation and editing of fund-factsheet page images. The credential nevertheless grants access to unrelated capabilities, including: - Video generation - Music generation - Speech generation - Voice-resource reading and modification - General wallet spending - Artifact reading and writing - Task reading and cancellation The authorization helper does not merely request these permissions opportunistically. It rejects an existing token unless its scope exactly equals the complete broad scope, preventing operation with a more restricted credential. The token is also shared across Beatra Skill packages. This expands the trust boundary: compromise of this Skill, another package using the same credential, or the package's update channel could expose permissions unrelated to fund-page image generation. This violates the principle of least privilege. The legitimate workflow appears to require image generation and editing, model disc ...[truncated 1402 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the shared full-scope token with a package-specific credential. 2. Request only the capabilities required by this Skill, such as: - Image generation and editing - Model discovery - Uploading explicitly selected reference images - Reading tasks created by this package 3. Remove video, music, speech, voice-write, and unrelated task-cancellation permissions. 4. Scope wallet spending to this package's approved operations rather than granting general spending authority. 5. Do not require exact equality with a globally broad scope. Validate that the token contains the minimum required scopes instead. 6. Require separate, explicit user authorization before adding any optional capability. 7. Isolate task and artifact access by package or installation reference where supported. 8. Rotate existing broad tokens after deploying the reduced-scope authorization model. ]]>
