Back to skill

Security audit

Lyrion Music

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Lyrion Music Server control skill, with some implementation and documentation issues users should review before use.

Install this only if you intend to let the agent control your Lyrion Music Server. Verify the correct LYRION_HOST and LYRION_PORT before use, keep it on a trusted network, and consider fixing JSON escaping before passing untrusted player IDs, search terms, or playlist URIs. Destructive media actions such as clearing playlists are disclosed but should be user-directed.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/lyrion.sh:56
Finding

Unescaped User Input Enables JSON-RPC Request Injection

Content
View full analysis

Vulnerability Details

File Location: scripts/lyrion.sh, lines 56-68
Vulnerability Type: JSON injection through unsafe request construction
Risk Level: Medium

Vulnerable Code

bash
send_request() {
    local player_id="$1"
    shift
    
    # Parameter als JSON-Array aufbauen
    local params=""
    for param in "$@"; do
        if [ -z "$params" ]; then
            params="\"$param\""
        else
            params="$params, \"$param\""
        fi
    done
    
    local json="{\"id\":1,\"method\":\"slim.request\",\"params\":[\"$player_id\",[$params]]}"
    
    curl -s -X POST \
        -H "Content-Type: application/json" \
        -d "$json" \
        "$URL"
}

Technical Analysis

The function manually constructs a JSON document by interpolating player_id and command parameters directly into quoted JSON strings. It does not escape quotation marks, backslashes, control characters, or other JSON-significant input.

Several commands pass caller-controlled values to this function, including player IDs, search terms, artist and album IDs, and playlist URIs. A crafted argument can therefore terminate its intended JSON string and alter the surrounding JSON structure. Depending on what the Lyrion Music Server parser accepts, this can produce malformed requests or inject modified RPC parameters and unintended operations.

Shell metacharacters inside these values are not evaluated as local shell commands because the variables are expanded inside quoted shell arguments. The confirmed weakness is JSON-RPC request injection, not local shell-command injection.

Attack Path

  1. An attacker obtains influence over arguments supplied to commands such as add, insert, playuri, search, or status.
  2. The attacker supplies a value containing JSON control characters, such as an unescaped quotation mark followed by crafted JSON structure.
  3. send_request concatena ...[truncated 1178 chars]
Remediation
View remediation

Remediation Suggestions

Replace manual JSON concatenation with a JSON-aware serializer. Every player ID and parameter must be supplied as data rather than inserted into JSON syntax.

A robust implementation can use Python's json module:

bash
send_request() {
    local player_id="$1"
    shift

    local json
    json="$(
        python3 - "$player_id" "$@" <<'PY'
import json
import sys

player_id = sys.argv[1]
command_parameters = sys.argv[2:]

print(json.dumps({
    "id": 1,
    "method": "slim.request",
    "params": [player_id, command_parameters],
}))
PY
    )" || return 1

    curl --silent --show-error --fail \
        --request POST \
        --header "Content-Type: application/json" \
        --data-binary "$json" \
        "$URL"
}

Alternatively, use jq -n with --arg and --args so that it performs all escaping. Do not attempt to secure the current concatenation using ad hoc character replacement.

Additional hardening should include:

  • Validate player IDs against the expected identifier format.
  • Enforce numeric ranges and formats for volume, index, artist ID, and album ID arguments.
  • Restrict URI schemes to those explicitly required by the Skill.
  • Add tests for quotation marks, backslashes, newlines, control characters, Unicode, and JSON-shaped arguments.
  • Use curl --fail --show-error and propagate failures rather than silently accepting server or transport errors.
  • Keep the plaintext HTTP API on a trusted network, or place it behind an authenticated TLS reverse proxy when requests cross an untrusted network.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/lyrion.sh (reported line 73)May include surrounding context.

sh
local json="{\"id\":1,\"method\":\"slim.request\",\"params\":[\"$player_id\",[$params]]}"
    
    curl -s -X POST \
        -H "Content-Type: application/json" \
        -d "$json" \
        "$URL"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill exposes shell-based operational capability via scripts/lyrion.sh but does not declare any tool scope such as permissions or allowed-tools. This creates an authorization and review gap: an agent may invoke shell unexpectedly, and because the script can control a networked service and accept user-supplied parameters, the undeclared capability increases the chance of misuse or unsafe execution.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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/lyrion.sh (reported line 73)May include surrounding context.

sh
local json="{\"id\":1,\"method\":\"slim.request\",\"params\":[\"$player_id\",[$params]]}"
    
    curl -s -X POST \
        -H "Content-Type: application/json" \
        -d "$json" \
        "$URL"

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description and all user-facing instructions are exclusively in German, which imposes a specific language on users without any opt-in or stated regional justification. This matches the language/locale policy violation category because the skill does not offer an alternative language or explain that it is intentionally German-only.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file uses German throughout headings, descriptions, and examples, which can impose a language constraint on users without explicit opt-in. Under the stated policy, forcing a specific language without offering a choice is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.