T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/auth.py:14- Finding
Unused Spotify Follow Permissions Violate Least Privilege
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Spotify skill does what it claims, but it asks for broad account powers and stores reusable Spotify tokens in a local config file without strong protection.
Review this before installing if you are not comfortable granting a local skill broad Spotify account access. Use a dedicated Spotify app credential, keep config.json private and out of version control, restrict its file permissions manually, and be careful with agent requests that could edit playlists, save tracks, transfer playback, or remove playlist items.
scripts/auth.py:14Unused Spotify Follow Permissions Violate Least Privilege
scripts/auth.py:45OAuth Credentials and Reusable Tokens Are Stored Without Permission Hardening
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
print()
print(" auth Print auth URL, prompt for code")
print(" auth <code> Exchange an authorization code directly")
print(" refresh Refresh the access token")
The skill advertises capabilities that involve environment variables, file writes, and network access, but it does not declare an explicit tool/permission scope. That creates a least-privilege gap: an agent or platform may invoke the skill without clear user-visible boundaries, increasing the chance of unintended access to secrets in env, modification of local files such as config.json, or outbound API activity.
The trigger list includes broad phrases such as 'play music' and 'playlist', which can cause the Spotify skill to activate on ambiguous requests that are not clearly asking to use Spotify. In an agent setting, this can lead to unintended playback changes, playlist modifications, or exposure of listening/profile data when a different action was intended.
The script persists sensitive OAuth material, including access tokens, refresh tokens, and potentially client secrets loaded from the same config file, to ../config.json without any protection, permission hardening, or user warning. If that file is readable by other local users, accidentally committed, backed up insecurely, or exposed by another component, an attacker could reuse the tokens to control the victim's Spotify account and access profile/playback data.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
sys.path.insert(0, SCRIPT_DIR)
from auth import get_valid_token
BASE = "https://api.spotify.com/v1"
def api(method, path, data=None, params=None):
The CLI exposes state-changing operations such as saving tracks, creating/editing playlists, and removing playlist items without any confirmation, dry-run mode, or guardrail at the command layer. In an agent-skill context, this increases the chance that a mistaken parse, prompt injection from surrounding workflow, or ambiguous user request will directly modify or delete user Spotify data.
The function always sends market="US" when requesting artist top tracks, which forces a specific locale-dependent result set. There is no opt-in, configuration option, or explanation that this skill is intentionally US-specific, so this is a natural-language/policy-style locale constraint issue.
Detected: suspicious.install_untrusted_source