Back to skill

Security audit

Routstr Skill

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly aligned with Routstr balance management, but it handles financial credentials and payment tokens in unsafe and under-scoped ways.

Review before installing. Use only on a trusted machine, with a Routstr API key you are comfortable exposing to these scripts, and avoid using Cashu tokens with this version because the token is placed in a URL where it may be logged or visible in process metadata. The invoice script should be fixed to validate amounts and align units before relying on it for payments.

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

T09 · Insecure Skill Coding Practices

Error
Location
create_invoice.sh:6
Finding

Unvalidated Input Evaluated as a Bash Arithmetic Expression

Content
View full analysis
" echo "Example: $0 1000" exit 1 fi # Convert sats to msats (API expects msats) AMOUNT_SATS="$1" AMOUNT_MSATS=$((AMOUNT_SATS * 1000)) ``` ### Technical Analysis The script only verifies that the first argument is nonempty. It does not ensure that the value is a decimal integer before using it in Bash arithmetic expansion. Bash arithmetic expressions can recursively interpret variable values as arithmetic syntax. Crafted values may introduce variable references, array subscripts, or command substitutions in arithmetic contexts. Consequently, treating untrusted input as an arithmetic expression can result in unintended command execution rather than a simple numeric conversion. The vulnerable expression executes with the privileges and environment of the user running the Skill. ### Attack Path 1. An attacker supplies or persuades the user or agent to supply a specially crafted invoice amount. 2. The value is copied unchanged into `AMOUNT_SATS`. 3. The script evaluates `AMOUNT_SATS` inside `$((...))`. 4. Bash interprets the crafted value as arithmetic syntax and may evaluate embedded expansion constructs. 5. Attacker-controlled commands execute under the account that invoked the script. ### Impact Assessment Successful exploitation may provide arbitrary command execution with the privileges of the current Skill user. This could permit access to files readable by that account, including `~/.openclaw/openclaw.json` and its Routstr API key, modification of user-owned data, execution of network requests, or installation of user-level persistence. The issue does not directly grant root privileges unless the script is separately invoked through a privileged executio ...[truncated 16 chars]
Remediation
View remediation
&2 exit 1 fi if (( 10#$AMOUNT_SATS == 0 || 10#$AMOUNT_SATS > 100000000 )); then echo "Error: amount_sats is outside the permitted range." >&2 exit 1 fi AMOUNT_MSATS=$((10#$AMOUNT_SATS * 1000)) ``` The `10#` prefix forces base-10 interpretation after validation. The maximum value should be selected according to the service's documented limits and should also prevent integer overflow. Add tests covering empty, negative, hexadecimal, oversized, malformed, and expression-like inputs. Consider enabling strict shell behavior with `set -euo pipefail`, while explicitly handling expected command failures. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
topup_cashu.sh:19
Finding

Cashu Bearer Token Exposed in Request URL and Process Arguments

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
topup_cashu.sh:6
Finding

Complete Cashu Token-Like Bearer Payload Embedded in Usage Output

Content
View full analysis
" echo "Example: $0 cashuBo2FteCJodHRwczovL21pbnQubWluaWJpdHMuY2FzaC9CaXRjb2luYXVjc2F0YXSBomFpSAAQeTfbDMhlYXCBo2FhAWFzeEBkNWJjNWYxYmE2YmJlNDQ2NGM3YmI1NjQ4MzBhNWY1ZDRjZDU3ZjJhOTQ3ZGQwYmE0ZjJmYjgwZTNlMmI4NmNhYWNYIQObVC-sFR3tVKwD08eDbJGrvP6J_IZ7k6k2Yn4CjY5Bog" exit 1 fi ``` ### Technical Analysis The help text contains a complete value with the structure and prefix of a Cashu token rather than a short, unmistakably invalid placeholder. Cashu tokens are bearer instruments and must be handled as secrets because possession may permit redemption. Static analysis cannot establish whether this particular token remains valid, has already been redeemed, or was generated solely as test data. Nevertheless, embedding a complete token-like payload in distributed source code creates an avoidable secret-exposure and accidental-redemption risk. It also encourages users to copy or reuse realistic financial credentials in documentation and command histories. ### Attack Path 1. An attacker obtains the publicly distributed or locally installed Skill package. 2. The attacker reads `topup_cashu.sh` and extracts the embedded token-like value. 3. The attacker submits the value to a compatible Cashu wallet or mint. 4. If the token is valid and unspent, the attacker may redeem or transfer its value. The final redemption step depends on the token still being valid and unspent; that condition cannot be confirmed from the audited source alone. ### Impact Assessment If the embedded value is valid and unspent, its monetary value may be stolen by anyone with access to the source package. If it is invalid or already redeemed, there is no direct financial loss, but retaining realistic bearer material still c ...[truncated 108 chars]
Remediation
View remediation
" echo "Example: $0 ''" exit 1 fi ``` Determine whether the embedded value was ever valid. If so, treat it as compromised, verify its redemption status, rotate or invalidate related test material where possible, and inspect repository history and published artifacts for copies. Add secret scanning rules capable of detecting Cashu token prefixes and prohibit genuine bearer tokens in source code, examples, tests, and documentation. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documentation introduces or implies financially sensitive actions such as Cashu-based top-ups without clearly reconciling them with the declared purpose. In a payment-related skill, incomplete or inconsistent disclosure is risky because it can cause users to trigger money-moving actions they did not expect from the stated scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The documentation introduces or implies financially sensitive actions such as Cashu-based top-ups without clearly reconciling them with the declared purpose. In a payment-related skill, incomplete or inconsistent disclosure is risky because it can cause users to trigger money-moving actions they did not expect from the stated scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documentation introduces or implies financially sensitive actions such as Cashu-based top-ups without clearly reconciling them with the declared purpose. In a payment-related skill, incomplete or inconsistent disclosure is risky because it can cause users to trigger money-moving actions they did not expect from the stated scope.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises shell and network-capable operations but declares no explicit tool scope or permissions. That creates an authorization gap where an agent or user may invoke a capability set broader than what is transparently documented, increasing the chance of unintended network access or command execution.

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 11)May include surrounding context.

md
## What I do
- Check current Routstr API balance (in sats and BTC)
- Display usage statistics (total spent, total requests)
- Create Lightning invoices for top-up payments
- Check payment status of existing invoices
- Top up balance using Cashu tokens

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script extracts a credential from ~/.openclaw/openclaw.json and transmits it via curl as a Bearer token. Although comments describe the mechanics, there is no user-facing disclosure, prompt, or warning in the script about credential use or the outbound network request.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script converts the user-supplied amount from sats to millisats, but then places that converted value into a JSON field named amount_sats. If the server interprets that field literally as sats, the created invoice could be 1000x larger than intended, causing accidental overpayment requests or operational loss.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The script transmits the Routstr API key inside the JSON request body during an external curl call. Sending credentials in the body rather than a standard authorization header increases exposure through logs, proxies, debugging output, and server-side request recording, and the skill context is balance management so credential misuse could directly affect funds-related operations.

Content

Scanner excerpt · create_invoice.sh (reported line 23)May include surrounding context.

sh
# Create invoice (note: API expects amount in msats)
echo "Creating $AMOUNT_SATS sat invoice..."
RESPONSE=$(curl -s -X POST "${BASE_URL}/balance/lightning/invoice" \
  -H "Content-Type: application/json" \
  -d "{\"amount_sats\": ${AMOUNT_MSATS}, \"purpose\": \"topup\", \"api_key\": \"${API_KEY}\"}")

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill manages balance by checking balance, creating Lightning invoices for top-up, and checking invoice payment status. This script instead performs a direct wallet top-up using a Cashu token via /wallet/topup, which is a distinct funding mechanism not mentioned in the manifest description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The Cashu token is placed in the request URL query string, which can be exposed through shell history, process listings, proxy logs, web server access logs, monitoring tools, and error telemetry. Because the token is a bearer-like value representing spendable value, disclosure can enable theft or replay by anyone who obtains logged URLs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly states that it reads configuration from a local file but does not warn that this file may contain sensitive API credentials. Users may run the skill without understanding that local secrets are being accessed, increasing the risk of accidental disclosure, misuse, or execution in inappropriate environments.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.