Back to skill

Security audit

Last.fm (OpenClaw)

Security checks for vulnerabilities and agentic risk

Overview

This Last.fm skill is mostly coherent, but it can change your Last.fm account and handles long-lived write credentials in a locally exposed way.

Install only if you are comfortable giving the skill your Last.fm API key and, for love/unlove, a long-lived session key and API secret. Prefer read-only use unless you need write actions, and avoid using write credentials on shared or heavily monitored machines because the current script may expose them through local process arguments.

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/lastfm-api.sh:92
Finding
Sensitive Last.fm credentials exposed through command-line arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/lastfm-api.sh:92-130`; `references/auth-guide.md:101-110` **Vulnerability Type**: Sensitive credential exposure through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code `scripts/lastfm-api.sh:92-130`: ```bash make_request() { local method="$1" shift local extra_params=("$@") local url="${LASTFM_API_ROOT}?method=${method}&user=$(url_encode "$LASTFM_USERNAME")&api_key=${LASTFM_API_KEY}&format=json" for param in "${extra_params[@]}"; do url+="&${param}" done curl -s "$url" } make_write_request() { local method="$1" local artist="$2" local track="$3" check_write_vars local artist_enc artist_enc=$(url_encode "$artist") local track_enc track_enc=$(url_encode "$track") local api_sig api_sig=$(generate_signature \ "api_key${LASTFM_API_KEY}" \ "artist${artist}" \ "method${method}" \ "sk${LASTFM_SESSION_KEY}" \ "track${track}" ) local url="${LASTFM_API_ROOT}" local data="method=${method}&api_key=${LASTFM_API_KEY}&artist=${artist_enc}&track=${track_enc}&sk=${LASTFM_SESSION_KEY}&api_sig=${api_sig}&format=json" curl -s -X POST -d "$data" "$url" } ``` `references/auth-guide.md:101-110`: ```bash API_KEY="your_api_key" API_SECRET="your_secret" TOKEN="your_token" # Create signature string (params in alphabetical order, without format) SIG_STRING="api_key${API_KEY}methodauth.getSessiontoken${TOKEN}${API_SECRET}" SIGNATURE=$(echo -n "$SIG_STRING" | md5sum | cut -d' ' -f1) # Request session key curl "https://ws.audioscrobbler.com/2.0/?method=auth.getSession&api_key=${API_KEY}&token=${TOKEN}&api_sig=${SIGNATURE}&format=json" ``` ### Technical Analysis The implementation expands the Last.fm API key, long-lived session key, API signature, artist name, and track name into arguments supplied directly to `curl`. HTT ...[truncated 2999 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Keep sensitive POST data out of the `curl` argument vector by supplying it through standard input: ```bash printf '%s' "$data" | curl --silent --show-error \ --request POST \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-binary @- \ "$LASTFM_API_ROOT" ``` 2. Prefer constructing form fields with `curl --data-urlencode` semantics, but use a protected configuration file or standard-input mechanism when fields contain session credentials. Do not place the long-lived session key directly in command arguments. 3. Avoid placing authentication tokens and signatures in URLs in documentation. Provide a small helper script that reads credentials from protected environment variables and transmits request data through standard input. 4. Warn users not to paste live secrets into interactive commands. If manual authentication is unavoidable, instruct them to disable history temporarily or execute the procedure in a non-interactive script with restrictive permissions. 5. Ensure any temporary credential or request files are created with owner-only permissions, such as mode `0600`, and deleted immediately after use. Prefer memory or standard input so no temporary file is needed. 6. Use `curl --silent --show-error --fail-with-body` and handle failures explicitly so authentication errors are detected without printing complete request data. 7. Rotate the API secret and revoke the Last.fm application session if process telemetry, shell history, or diagnostic logs may already contain these values. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Chaining Abuse

High
Category
Tool Misuse
Content
Install on Ubuntu/Debian:

```
sudo apt-get update && sudo apt-get install -y jq curl
```

### 1. Get a Last.fm API Key
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
Install on Ubuntu/Debian:

```
sudo apt-get update && sudo apt-get install -y jq curl
```

### 1. Get a Last.fm API Key
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Session Persistence

Medium
Category
Rogue Agent
Content
### 1. Get a Last.fm API Key

1. Visit https://www.last.fm/api/account/create
2. Fill in the application details:
   - **Name**: Your preferred name (e.g., "OpenClaw Integration")
   - **Description**: "Personal OpenClaw skill for Last.fm"
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.

Session Persistence

Medium
Category
Rogue Agent
Content
env: {
          LASTFM_API_KEY: "required",
          LASTFM_USERNAME: "required",
          LASTFM_SESSION_KEY: "optional, for write ops",
          LASTFM_API_SECRET: "optional, for write ops"
        }
      }
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.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill explicitly describes use of shell utilities (`curl`, `jq`) and outbound network access, but it does not declare any tool scope such as allowed tools or permissions. That creates an unnecessary trust gap: an agent or runtime may permit broader shell/network capability than the skill actually needs, increasing the blast radius if the skill is misused or later modified.

Session Persistence

Medium
Category
Rogue Agent
Content
## Setup Instructions

1. Get a Last.fm API key at https://www.last.fm/api/account/create
2. Add to `~/.openclaw/openclaw.json`:

```json5
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.

Session Persistence

Medium
Category
Rogue Agent
Content
| Desktop Auth | Write operations (local app) | API key + secret |
| Web Auth | Write operations (web app) | API key + secret + callback URL |

This skill uses **Desktop Auth** for write operations.

---
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.

External Transmission

Medium
Category
Data Exfiltration
Content
url+="&${param}"
    done
    
    curl -s "$url"
}

make_write_request() {
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The `love` and `unlove` commands perform authenticated POST requests that modify the user's Last.fm data, but the execution path contains no confirmation prompt and no explicit user-facing warning at the point of action. Although the usage text notes that a session key is required, it does not clearly warn that these commands will immediately change account state when invoked.

Missing User Warnings

Low
Confidence
89% confidence
Finding
The skill supports state-changing operations (`love` and `unlove`) against the user's Last.fm account but does not present a prominent warning or confirmation requirement before describing those actions. This can lead to unintended account modifications, especially in agentic contexts where commands may be inferred or executed with limited user awareness.

Missing User Warnings

Low
Confidence
84% confidence
Finding
This markdown file describes `track.love` and `track.unlove`, which change a user's Last.fm account state, but it does not include any warning that these are write operations affecting user data. Under the markdown-file criteria for missing user warnings, destructive or data-affecting behaviors should be explicitly disclosed.

Static analysis

No suspicious patterns detected.