Back to skill

Security audit

beatra-ai-music-creator

Security checks for vulnerabilities and agentic risk

Overview

This music skill is mostly coherent, but it should be reviewed because it uses broad Beatra account permissions and silently updates its own code by default.

Install only if you are comfortable granting Beatra a shared device authorization that covers more than music, stores a persistent local token, reports device/platform metadata, and can auto-update package code. Consider disabling auto-updates with the documented command and revoke the device in the Beatra Console when no longer needed.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/authorize.py:34
Finding

Over-Privileged Shared Device Token Enables Unrelated Beatra Operations

Content
View full analysis

Vulnerability Details

File Location: scripts/authorize.py:34-38
Vulnerability Type: Excessive OAuth scope and missing least-privilege enforcement
Risk Level: High

Complete Code Snippet

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 resulting token is subsequently accepted by a generic tool dispatcher in scripts/mcp_client.py:1466-1479:

python
def _run_command(command: str, tool_name: str | None = None) -> dict[str, Any]:
    session = _session_with_registration(
        state_dir=Path.home() / ".beatra",
        post_json=_default_post_json,
    )
    if command == "tools":
        return session.request(2, "tools/list", {})
    try:
        arguments = json.load(os.sys.stdin)
    except json.JSONDecodeError as exc:
        raise RuntimeError("Tool arguments on stdin must be one JSON object") from exc
    if not isinstance(arguments, dict):
        raise RuntimeError("Tool arguments on stdin must be one JSON object")
    assert tool_name is not None
    return session.request(
        2,
        "tools/call",
        {"name": tool_name, "arguments": arguments},
    )

Technical Analysis

The declared Skill functionality is music creation, reference-audio upload, model discovery, and management of associated asynchronous tasks. However, authorization requests a shared bearer token containing unrelated capabilities, including:

  • Image generation
  • Video generation
  • Speech generation
  • Voice read and write operations
  • General artifact read and write access
  • Wallet spending
  • Task cancellation

The token is shared with other Beatra packages through ~/.beatra/credentials.json. The command-line client also accepts an arbitrary MCP tool name without enforcing a package-specific allowlist. Consequently, local code capable of invoking the bundled client can attempt ope ...[truncated 1308 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the shared full-scope token with a package-specific token restricted to required music operations.
  2. Remove image, video, speech, voice-write, and unrelated artifact permissions from this Skill's authorization request.
  3. Separate wallet authorization from generation authorization, or constrain spending to explicitly approved music operations.
  4. Add a local allowlist of permitted MCP tools, such as music generation, model discovery, reference upload, and task operations required by this workflow.
  5. Reject arbitrary tool names before establishing an authenticated session.
  6. Use separate credentials for packages requiring materially different capabilities.
  7. Display the exact requested scopes during authorization and require renewed consent whenever privileges expand.

other

Warning
Location
scripts/authorize.py:341
Finding

Hostname and Agent-Environment Metadata Are Collected and Transmitted

Content
View full analysis

Vulnerability Details

File Location: scripts/authorize.py:341-370 and scripts/authorize.py:475-488
Vulnerability Type: Unnecessary environment reconnaissance and telemetry
Risk Level: Medium

Complete Code Snippet

python
def detect_host_platform(explicit: str | None = None) -> str:
    """The agent environment this process runs inside (docs/device-model.md).

    Order: explicit agent self-report > environment signatures > unknown.
    Detection reads the process environment only — nothing else runs,
    nothing reaches the network.
    """
    if explicit:
        candidate = explicit.strip().lower().replace(" ", "-")
        if _PLATFORM_VALUE.fullmatch(candidate):
            return candidate
    env = os.environ
    if env.get("CLAUDECODE") == "1" or "CLAUDE_CODE_ENTRYPOINT" in env:
        return "claude-code"
    if any(key.startswith("CODEX_") for key in env):
        return "codex"
    ai_agent = env.get("AI_AGENT", "").lower()
    matched = re.match(r"([a-z0-9-]+)_", ai_agent)
    if matched and _PLATFORM_VALUE.fullmatch(matched.group(1)):
        return matched.group(1)
    return "unknown"


def device_display_name() -> str | None:
    """A hostname the user will recognise in the console device list."""
    try:
        name = socket.gethostname().strip()
    except OSError:
        return None
    if not name or not name.isprintable():
        return None
    return name[:120]

The collected information is added to the remote authorization request:

python
external_reference = _installation_reference(state_dir)
form: dict[str, str] = {
    "client_id": CLIENT_ID,
    "resource": MCP_URL,
    "scope": SCOPE,
    "platform": host_platform,
    "client_name": PACKAGE_DISPLAY_NAME,
    "external_installation_ref": external_reference,
    "package_version": PACKAGE_VERSION,
    "package_slug": PACKAGE_SLUG,
}
if device_name:
    form["device_name"] = device_name
status, created = post_form(DEVICE_AUTHORIZATION_URL, 
...[truncated 1801 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not transmit the operating-system hostname by default.
  2. Generate a random, non-identifying local device alias for console display.
  3. Make hostname and platform telemetry explicitly opt-in.
  4. Present the exact metadata and purpose before obtaining consent.
  5. Permit users to supply a custom display name without reading the hostname.
  6. Default the platform field to unknown unless it is technically required.
  7. Minimize retention and correlation of the stable installation reference and document its lifecycle.

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/mcp_client.py:969
Finding

Default Silent Updater Retrieves and Installs Remotely Controlled Code

Content
View full analysis

Vulnerability Details

File Location: scripts/mcp_client.py:969-1019
Vulnerability Type: Automatic remote payload retrieval and package-code replacement
Risk Level: High

Complete Code Snippet

python
def maybe_auto_update(
    *,
    state_dir: Path | None = None,
    install_root: Path | None = None,
    get_bytes: GetBytes = _default_get_bytes,
    now: float | None = None,
) -> bool:
    """Best-effort silent update. Never block the requested MCP command."""

    resolved_state = state_dir or Path.home() / ".beatra"
    try:
        resolved_root = (install_root or _current_install_root()).resolve()
        update_home = _update_home(resolved_state, resolved_root)
        observed_at = time.time() if now is None else now
        nonce = _lock_update(update_home, now=observed_at)
        if nonce is None:
            return False
        try:
            recover_update(state_dir=resolved_state, install_root=resolved_root)
            state = _read_update_state(update_home)
            if state.get("auto_update", True) is False:
                return False
            last_checked = state.get("last_checked_at")
            if (
                isinstance(last_checked, (int, float))
                and observed_at - float(last_checked) < UPDATE_CHECK_MAX_AGE_SECONDS
            ):
                return False
            state["last_checked_at"] = observed_at
            _write_private_json(update_home / "state.json", state)
            checked = check_update(get_bytes=get_bytes)
            if not checked["update_available"]:
                return False
            _ensure_owned_baseline(
                install_root=resolved_root,
                update_home=update_home,
                get_bytes=get_bytes,
            )
            discovery = checked["discovery"]
            manifest, new_files = download_update(discovery, get_bytes=get_bytes)
            _apply_update(
                install_root=resolved_root,
             
...[truncated 3202 chars]
Remediation
View remediation

Remediation Suggestions

  1. Disable automatic installation by default; update checks may remain optional and non-mutating.
  2. Require explicit user approval before downloading or replacing package code.
  3. Sign release metadata and archives with an offline-controlled signing key.
  4. Pin the verification public key or an appropriately constrained trust root in the audited client.
  5. Verify signatures before trusting versions, URLs, hashes, manifests, or archives.
  6. Add signed rollback-protection metadata to prevent replay of older trusted releases.
  7. Display the current version, target version, changed files, publisher identity, and signature status before installation.
  8. Keep the existing path validation, file-size limits, ownership checks, transactional replacement, and rollback controls.
  9. Consider distributing updates through the host platform's reviewed package mechanism instead of an application-level self-updater.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (33)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill materials also describe uninstall, token revocation, credential deletion, and shared connection management operations, which are unrelated to the user-facing promise of generating music. Packaging destructive or account-affecting behaviors alongside a creative tool without clear upfront disclosure increases the risk of unintended state changes and misuse of stored credentials.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill materials also describe uninstall, token revocation, credential deletion, and shared connection management operations, which are unrelated to the user-facing promise of generating music. Packaging destructive or account-affecting behaviors alongside a creative tool without clear upfront disclosure increases the risk of unintended state changes and misuse of stored credentials.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill materials also describe uninstall, token revocation, credential deletion, and shared connection management operations, which are unrelated to the user-facing promise of generating music. Packaging destructive or account-affecting behaviors alongside a creative tool without clear upfront disclosure increases the risk of unintended state changes and misuse of stored credentials.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
[music recipes](references/music-recipes.md) as patterns rather than fixed

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
[music recipes](references/music-recipes.md) as patterns rather than fixed

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · manifest.json (reported line 71)May include surrounding context.

json
```

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/installation-and-auth.md (reported line 14)May include surrounding context.

text

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/installation-and-auth.md (reported line 21)May include surrounding context.

text

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/installation-and-auth.md (reported line 49)May include surrounding context.

text

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/mcp-connection.md (reported line 10)May include surrounding context.

text

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/authorize.py (reported line 207)May include surrounding context.

python
```

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/mcp_client.py (reported line 1025)May include surrounding context.

python
```

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/uninstall.py (reported line 40)May include surrounding context.

python
```

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/uninstall.py (reported line 109)May include surrounding context.

python
```

They share the one full-scope Device Token stored in
`~/.beatra/credentials.json`. Installing or switching packages must not trigger
another authorization when that credential is already valid. Do not add,
enable, trust, or configure a host Beatra Connector. Never print or move the
token into command arguments, environment variables, logs, chat, or another

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

The script stores a long-lived bearer access token in plaintext JSON on disk under the user’s home directory. If another local process, malware instance, backup system, or misconfigured permission boundary can read that file, the token can be reused to access Beatra MCP capabilities with broad scopes including wallet spending, artifact access, and media generation.

Content

Scanner excerpt · scripts/authorize.py (reported line 514)May include surrounding context.

python
scope = _required_string(polled, "scope")
            if set(scope.split()) != set(SCOPE.split()):
                raise RuntimeError("Beatra authorization returned an unsupported scope")
            credential_path = state_dir / "credentials.json"
            _atomic_json(
                credential_path,
                {

Self-Modification

High
Category
Rogue Agent
Confidence
95% confidence
Finding

Exposing a self-update command that can replace package files is a self-modification capability inconsistent with the narrow purpose of a music-generation skill. In the skill context, local code mutation is especially dangerous because users and host agents may grant the skill creative access, not software-maintenance authority, so compromise of the update path could yield persistent execution changes.

Content

Scanner excerpt · scripts/mcp_client.py (reported line 1503)May include surrounding context.

python
)
    update = subparsers.add_parser(
        "update",
        help="Check, install, or configure Beatra package self-updates",
    )
    update.add_argument(
        "--check",

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill exposes broad operational capabilities (environment, file access, network, shell) without declaring a restrictive tool scope, while instructing use of a bundled Python client for all operations. That increases the blast radius if the skill or bundled scripts are abused, because the agent may have more access than is necessary for music generation and account-linked API use.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
---
name: "beatra-ai-music-creator"
description: "Create original songs, AI-generated music, lyrics-to-song tracks, instrumentals, background music, video soundtracks, jingles, multilingual songs, and reference-led arrangements from a clear creative brief. This AI music generator and AI song maker develops genre, mood, structure, singable lyrics, vocal direction, and production style, then creates reviewable audio with Suno 5.5 or another model you explicitly choose. Use it as an AI music studio for songwriting, an AI lyrics writer, text-to-music creation, BGM generation, brand music, podcast themes, game music, bilingual songs, or focused new versions of reference audio. Review vocals, pronunciation, duration, loop points, and arrangement fit after generation, then refine the strongest result."
---

# AI Music Creator

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · manifest.json (reported line 9)May include surrounding context.

json
---
name: "beatra-ai-music-creator"
description: "Create original songs, AI-generated music, lyrics-to-song tracks, instrumentals, background music, video soundtracks, jingles, multilingual songs, and reference-led arrangements from a clear creative brief. This AI music generator and AI song maker develops genre, mood, structure, singable lyrics, vocal direction, and production style, then creates reviewable audio with Suno 5.5 or another model you explicitly choose. Use it as an AI music studio for songwriting, an AI lyrics writer, text-to-music creation, BGM generation, brand music, podcast themes, game music, bilingual songs, or focused new versions of reference audio. Review vocals, pronunciation, duration, loop points, and arrangement fit after generation, then refine the strongest result."
---

# AI Music Creator

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill states that the bundled client may automatically install a higher package version without separate confirmation. Even with claimed verification, silent self-update is a supply-chain and trust-boundary risk because code executed under the skill can change after initial review, introducing new behaviors or permissions without renewed user approval.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document states that the client silently checks for updates during ordinary commands and automatically installs higher versions without separate confirmation. Even with integrity checks and rollback protections, modifying the local installation by default during unrelated user workflows is a security-relevant behavior because it expands the trusted execution path and can surprise users with code changes they did not explicitly authorize at that moment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document describes silent default update checks against remote Beatra infrastructure before ordinary commands but does not foreground the privacy and network implications of that behavior. Users may unknowingly disclose usage metadata such as IP address, timing, installation channel/locale, and command-triggered contact with vendor infrastructure during routine use, which is especially sensitive in an agent skill that may run frequently or in automated environments.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/installation-and-auth.md (reported line 64)May include surrounding context.

md
the user signs in or creates their account there, and the approval page
  continues automatically after sign-in;
- say once that the connection continues automatically after Allow, then
  detect completion yourself — never ask the user to confirm in chat that
  they approved.

Approval legitimately takes minutes when sign-in or account creation is

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The markdown instructs the agent to default to 'Hong Kong Cantonese to Traditional Chinese unless the user asks otherwise.' This imposes a specific regional and script preference by default rather than offering a user choice, which matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The client includes a full self-update system that downloads archives from the network and overwrites local package files, which materially exceeds the stated music-creation purpose of the skill. Even though the code validates HTTPS, manifests, and checksums, this is still a software-update channel embedded in a skill, creating a powerful code-modification capability that could be abused if the vendor/CDN/discovery path is compromised or if users did not expect local mutation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.