Back to skill

Security audit

Music Recommender

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent music recommender, but its instructions use unsafe shell command patterns with user-controlled playlist and song values.

Review before installing. The music features are understandable, but the command examples should be hardened first: validate playlist IDs as numeric, avoid shell interpolation for artist/song values, use argument-array execution, and replace the predictable /tmp output path with a secure temporary file. Also expect playlist IDs and search terms to be sent to NetEase and Bilibili, and recommendation history to remain in the OpenClaw workspace.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:19
Finding

Shell Command Injection Through Untrusted Playlist and Search Values

Content
View full analysis
> /tmp/playlist_.json ``` ``` ```bash For each recommended song, search Bilibili for a playable link: ```bash python3 {baseDir}/scripts/search_bilibili.py " 官方MV" ``` ``` ### Technical Analysis The Skill instructs the Agent to construct shell commands by interpolating playlist IDs, artist names, and song names. The playlist identifier is not quoted or constrained to numeric characters. Consequently, shell metacharacters in that value can introduce additional commands, redirections, pipelines, or substitutions. The Bilibili search value is enclosed in double quotes, but double quotes do not disable shell command substitution. Values containing constructs such as `$(command)` or backticks can still cause commands to execute before Python receives the resulting argument. The Python scripts do not directly invoke a shell. The vulnerability exists in the documented invocation workflow: it becomes exploitable when an Agent follows the instructions using a shell-based execution tool and substitutes untrusted values into the command strings. ### Attack Path 1. An attacker provides a crafted playlist link or another input from which a malicious playlist identifier is extracted. Alternatively, attacker-influenced artist or song metadata reaches the Bilibili search step. 2. The malicious value contains shell syntax, such as a command separator for the unquoted playlist ID or command substitution syntax for the double-quoted search query. 3. The Agent substitutes the value into the command shown in `SKILL.md`. 4. The Agent executes the resulting string through a shell. 5. The shell interprets the injected syntax and executes the attacker-selected local command in additio ...[truncated 1041 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:19
Finding

Predictable Temporary File Permits Symlink-Based File Clobbering

Content
View full analysis
> /tmp/playlist_.json ``` ``` ### Technical Analysis The workflow writes playlist output to a predictable filename in the shared `/tmp` directory. The filename is derived directly from a known or guessable playlist ID and is opened through shell redirection. Shell redirection normally opens or truncates the target before starting the Python process. It does not ensure that the path was freshly and exclusively created, and it follows symbolic links. On a multi-user system, another local user may create the expected path in advance as a symbolic link to a file writable by the Agent account. This creates a time-of-check/time-of-use and symlink-following weakness. No secure temporary-file primitive, exclusive creation mode, ownership verification, or symlink rejection is specified. ### Attack Path 1. A local attacker learns or predicts the playlist ID that the Agent will process. 2. The attacker creates `/tmp/playlist_.json` as a symbolic link to another file. 3. The Agent follows the documented workflow and executes the command with shell redirection. 4. The shell follows the symbolic link and opens the linked target using the Agent’s privileges. 5. The target is truncated and then overwritten with playlist JSON output. Exploitation requires local access to the same system and a target path writable by the Agent process. The exact feasibility may also depend on operating-system protections for symlinks in shared temporary directories. ### Impact Assessment A successful attack can overwrite or corrupt files writable by the Agent account. Potential targets include workspace files, user configuration, application state, or other data owned by the same account. The primitive writes J ...[truncated 278 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The code's actual function is narrow playlist analysis: it summarizes total tracks, unique artists, top artists, and rough language mix inferred from song titles. That partially aligns with 'analyze playlist taste,' but the declared primary purpose centers on recommending songs that match the user's taste and includes behavioral guarantees (once per day, never repeat songs) plus link support. None of those recommendation, persistence, or link-processing capabilities appear in this code chunk. Therefore the description materially overstates and misrepresents what the supplied code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description promises a recommendation system with user-intent triggers, taste matching, once-per-day behavior, and deduplication of previously recommended songs, plus Bilibili link support. The supplied code does not implement any of those behaviors. Its sole function is to retrieve a NetEase playlist's tracks from the NetEase API using a provided playlist ID and print them as JSON. While fetching playlist contents could be a supporting component of a recommendation workflow, this code chunk by itself materially underdelivers relative to the declared primary purpose and omits several specifically claimed capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose centers on music recommendation driven by NetEase Cloud Music playlist analysis, including stateful behaviors like daily limits and avoiding repeats. In contrast, the code chunk is a simple Bilibili search utility: it sends a query to Bilibili's search API and returns the first video result. While Bilibili support is mentioned in the description, this code does not implement recommendation logic, playlist parsing, taste analysis, or repeat/daily controls. Its primary purpose is materially different from the declared skill behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill invokes network access, reads files, and writes persistent history, but does not declare any tool restrictions or permissions boundary. This increases the chance that an agent runtime grants broader-than-necessary capabilities, making unintended data access, persistent storage, or external transmission harder to govern and audit.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger includes the generic phrase 'music', which is broad enough to activate the skill in many unrelated conversations. Overbroad activation can cause unexpected network requests, file reads/writes, or persistent history storage when the user did not intend to invoke this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill persistently stores recommendation history in the user's workspace but does not clearly warn about that retention in the main description. Undisclosed persistence can expose user preference data over time, surprise users, and create privacy and data-minimization issues if the workspace is shared or later accessed by other tools.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The optional save step expands the skill from music recommendation into writing data to other systems and formats, including Notion and generated HTML files. Capability expansion beyond the core task increases the attack surface for data exfiltration, persistence, and unintended content generation, especially when not tightly scoped or consent-gated.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 124)May include surrounding context.

md
def search_bilibili(query: str) -> str:
    encoded = urllib.parse.quote(query)
    url = f"https://api.bilibili.com/x/web-interface/search/all/v2?keyword={encoded}&page=1"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
        "Referer": "https://www.bilibili.com/",

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/search_bilibili.py (reported line 17)May include surrounding context.

python
def search_bilibili(query: str) -> str:
    encoded = urllib.parse.quote(query)
    url = f"https://api.bilibili.com/x/web-interface/search/all/v2?keyword={encoded}&page=1"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
        "Referer": "https://www.bilibili.com/",

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The code fixes language categories to English labels such as "chinese", "english", "japanese", and "korean", and later prints all user-facing output in English. Under the stated policy, forcing a specific language or locale without user opt-in can be a natural-language policy issue when no alternative or justification is provided.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This code sends the user's search query to an external Bilibili endpoint, but there is no user-facing warning, log message, or inline comment/docstring explicitly disclosing that the query will be transmitted over the network. For a code file, outbound HTTP calls that transmit user data should have some form of visible disclosure unless clearly covered elsewhere.

Content

No source excerpt is available for this finding.