Back to skill

Security audit

Ai Music

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it claims, but an undocumented endpoint override can send the user's MakebestMusic API key and prompts to an arbitrary server if the runtime environment is influenced.

Review this skill before installing. It needs a MakebestMusic key and will send your music prompts to the service. Only use it in an environment where other tools or workspace configuration cannot set MBM_API_BASE, or ask the publisher to remove or validate that override so credentials are sent only to the official HTTPS MakebestMusic API.

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

Warning
Location
scripts/generate.js:3
Finding
Unvalidated API Base Override Can Exfiltrate API Credentials and Music Prompts<![CDATA[ ## Vulnerability Details **File Location**: `scripts/generate.js`, lines 3-36 **Vulnerability Type**: Unrestricted network destination with sensitive authorization data **Risk Level**: Medium ### Vulnerable Code ```js const API_BASE = process.env.MBM_API_BASE || "https://api.makebestmusic.com"; const API_KEY = process.env.apiKey; ``` ```js const res = await fetch(`${API_BASE}/api/skill/generate_music`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${API_KEY}`, }, body: JSON.stringify({ model: "Fi", custom: true, instrumental: instrumental, prompt: prompt, title: "", style: "", advance: { vocal_gender: "", ai_lyrics: true } }), }); ``` ### Technical Analysis The generation operation legitimately needs to send the configured API key and user-provided music prompt to MakebestMusic. However, the destination is derived from the undocumented `MBM_API_BASE` environment variable without validating its protocol or hostname. An attacker or compromised component capable of influencing the process environment can replace the intended API origin with an arbitrary server. The script will then attach the MakebestMusic bearer credential and transmit the user's prompt to that server. The override can also specify an unencrypted HTTP URL, allowing interception of the credential and prompt in transit. This behavior exceeds the minimum privileges required by the declared functionality. Production music generation only requires communication with the fixed MakebestMusic HTTPS API. ### Attack Path 1. An attacker gains the ability to influence the environment used to launch the Skill, such as through compromised workspace configuration, another privileged component, or operator deception. 2. The attacker sets `MBM_API_BASE` to an attacker-controlled URL, for example `https://attacker.example`. 3. A user requests music generation. 4. The script sends a POST request ...[truncated 835 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the production endpoint override and use a fixed trusted origin: ```js const API_BASE = "https://api.makebestmusic.com"; ``` 2. If an override is operationally necessary, parse and validate it before making any request: ```js const DEFAULT_API_BASE = "https://api.makebestmusic.com"; const ALLOWED_HOSTS = new Set(["api.makebestmusic.com"]); function getApiBase() { const url = new URL(process.env.MBM_API_BASE || DEFAULT_API_BASE); if (url.protocol !== "https:" || !ALLOWED_HOSTS.has(url.hostname)) { throw new Error("Invalid API endpoint"); } return url.origin; } const API_BASE = getApiBase(); ``` 3. Never attach the authorization header until the final request URL has been checked against an explicit HTTPS origin allowlist. 4. Keep development and test endpoints separate from production configuration and use non-production credentials for testing. 5. Document all supported environment variables and their security implications. 6. Apply least privilege and usage limits to API keys, and rotate the credential if it may have been used while an untrusted endpoint override was present. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/query.js:3
Finding
Unvalidated Status API Destination Can Exfiltrate API Credentials and Music Identifiers<![CDATA[ ## Vulnerability Details **File Location**: `scripts/query.js`, lines 3-30 **Vulnerability Type**: Unrestricted network destination with sensitive authorization data **Risk Level**: Medium ### Vulnerable Code ```js const API_BASE = process.env.MBM_API_BASE || "https://api.makebestmusic.com"; const API_KEY = process.env.apiKey; ``` ```js const res = await fetch(`${API_BASE}/api/skill/music_status?${musicIdsParam}`, { headers: { Authorization: `Bearer ${API_KEY}`, }, }); ``` ### Technical Analysis Querying generation status requires sending the API key and relevant music identifiers to the MakebestMusic service. However, `MBM_API_BASE` controls the request origin and is not restricted to the declared MakebestMusic HTTPS endpoint. If an attacker can influence this environment variable, the script sends the bearer credential and music IDs to an arbitrary network destination. A plain HTTP destination is also accepted, creating an additional interception risk. The script therefore delegates control over the recipient of sensitive authorization material to mutable environment configuration without establishing a trust boundary. The endpoint override is not required for the Skill's normal status-query functionality and exceeds the minimum network flexibility needed in production. ### Attack Path 1. An attacker influences the environment from which the Skill script is launched. 2. The attacker sets `MBM_API_BASE` to a server under their control or to an unencrypted HTTP endpoint. 3. The user or agent checks the status of generated music. 4. The script requests the attacker-selected endpoint and includes the MakebestMusic bearer credential. 5. The request URL also exposes the queried music IDs. 6. The attacker captures the credential and identifiers and may reuse the credential against the legitimate service within its authorized scope. ### Impact Assessment Successful exploitation can disclose: - The configured MakebestMusic API bearer crede ...[truncated 489 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Hard-code the trusted production API origin when custom endpoints are unnecessary: ```js const API_BASE = "https://api.makebestmusic.com"; ``` 2. If endpoint configurability must remain, require HTTPS and enforce an exact hostname allowlist before constructing the request or attaching credentials. 3. Reject URLs containing unexpected usernames, passwords, ports, or origins; use `new URL()` and compare the normalized `origin`. 4. Use separate, restricted credentials for development or staging endpoints rather than sending production credentials to configurable hosts. 5. Consider sending identifiers in a request body where supported to reduce exposure in URL logs, proxies, and monitoring systems. This does not replace destination validation. 6. Rotate any credential suspected of having been sent to an untrusted endpoint and review API activity for unauthorized use. ]]>
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (4)

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill instructs the agent to execute local Node.js scripts that use an API key and make outbound network requests, but it does not declare any explicit tool scope such as allowed-tools or permissions. This creates an authorization and review gap: the skill appears less privileged than it really is, making it easier to run code and access secrets without clear operator awareness or policy enforcement.

Session Persistence

Medium
Category
Rogue Agent
Content
---
name: text-to-music
description: AI music generation assistant powered by MakebestMusic. Use when user wants to create AI-generated music, songs, or audio tracks. Perfect for content creators, musicians, and anyone wanting custom AI music. Triggers on requests like "create a song", "generate music", "makebestmusic", "AI music", "write a melody", etc.
version: 1.2.0
metadata:
  openclaw:
Confidence
66% confidence
Finding
The skill explicitly supports asynchronous generation and later status checks ('How's my song going?'), which implies persistence of external task identifiers across turns. If session/task state is not clearly scoped to the initiating user or conversation, another user or session could query or surface someone else's generation results, causing cross-session data leakage.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrases are broad and include common requests like 'create a song' and 'generate music,' which can cause the skill to activate in loosely related contexts. Over-broad invocation increases the chance that the agent will unnecessarily run code, use the configured API key, or send user content to a third-party service when the user did not clearly intend to use this integration.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
The setup instructions direct users to "MBM官网", introducing Chinese-language guidance in an otherwise English skill without stating that the skill is China-specific or giving users a language/locale option. This can violate language/locale policy expectations when a skill implicitly assumes a specific language context without opt-in.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/generate.js:3

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/query.js:3