T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/authorize.py:35- Finding
Overprivileged Device Authorization Exceeds the Skill's Functional Requirements
- Content
View full analysis
Vulnerability Details
File Location:
scripts/authorize.py:35-38
Vulnerability Type: Excessive OAuth authorization scope
Risk Level: HighVulnerable 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 is declared as a coworking playlist generator. Its legitimate operations include reading music-model information, generating music, reading and canceling associated tasks, and accessing the wallet functions required for estimates or billing.
The requested Device Token also grants unrelated permissions for image generation, video generation, speech generation, voice reading and writing, and generic artifact access. The broad
mcp:toolspermission may further expand the effective authority available through the MCP endpoint.This violates least privilege because compromise or misuse of the shared token would provide access to capabilities that are not required to produce coworking music playlists. The documentation confirms that this broad authorization is intentional at
references/installation-and-auth.md:73-74and that the token is shared across Beatra Skills atreferences/mcp-connection.md:9-10.Attack Path
- The user runs
scripts/authorize.py. - The authorization request includes the complete scope shown above.
- The user approves the Device Authorization, and the resulting bearer token is stored in
~/.beatra/credentials.json. - An attacker who compromises the credential, the local client, or another component with access to the shared credential uses it against the Beatra MCP endpoint.
- The attacker invokes unrelated image, video, speech, voice, or artifact operations and may spend account credits through permissions that this playlist Skill did not legitimately require.
Impact Ass
...[truncated 655 chars]
- The user runs
- Remediation
View remediation
Remediation Suggestions
- Replace the full cross-media scope with a package-specific least-privilege scope limited to:
- Music generation.
- Music-model and pricing reads.
- Task reads for tasks created by this package.
- Cancellation of tasks created by this package.
- Narrowly scoped wallet balance, ledger, and spending operations where required.
- Remove image, video, speech, and voice permissions from this Skill's authorization request.
- Avoid a generic
mcp:toolsgrant when individual tool or capability scopes can be enforced. - Bind authorization to the package identity and enforce that identity server-side rather than relying only on telemetry fields such as
source_package_slug. - Use separate credentials or capability tokens for unrelated Beatra Skills so compromise of one package does not expose every enabled media capability.
- Display the exact requested capabilities to the user before opening the authorization page.
- Add automated tests that compare the requested scopes against an explicit allowlist for the coworking playlist workflow.
- Replace the full cross-media scope with a package-specific least-privilege scope limited to:
