Back to skill

Security audit

Gotchi Pocket

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly purpose-aligned for Aavegotchi wallet operations, but it handles financial transactions and Bankr credentials with under-scoped endpoint and credential-discovery behavior users should review before installing.

Install only if you trust the publisher and your runtime environment. Keep BANKR_API_URL unset unless intentionally testing, protect and rotate BANKR_API_KEY, review every deposit or withdrawal before execution, and avoid using this skill where untrusted agents or wrappers can control environment variables.

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/lib.sh:7
Finding
Bankr API key can be transmitted to an attacker-controlled endpoint<![CDATA[ ## Vulnerability Details **File Location**: `scripts/lib.sh:7-9`, `scripts/lib.sh:81-97`, `scripts/lib.sh:223-241`, and `scripts/lib.sh:244-280` **Vulnerability Type**: Unrestricted credential destination and sensitive information disclosure **Risk Level**: Medium ### Vulnerable Code The Bankr API endpoint can be overridden through an environment variable without validating its scheme or destination: ```bash AAVEGOTCHI_DIAMOND="${AAVEGOTCHI_DIAMOND:-0xA99c4B08201F2913Db8D28e71d020c4298F29dBF}" BASE_RPC_URL="${BASE_MAINNET_RPC:-https://mainnet.base.org}" BANKR_API_URL="${BANKR_API_URL:-https://api.bankr.bot}" ``` The API key is retrieved not only from the current environment but also from the user service environment and local Bankr configuration files: ```bash resolve_bankr_api_key() { local key="${BANKR_API_KEY:-}" if [ -z "$key" ] && command -v systemctl >/dev/null 2>&1; then key="$(systemctl --user show-environment 2>/dev/null | sed -n "s/^BANKR_API_KEY=//p" | head -n1 || true)" fi if [ -z "$key" ] && [ -f "$HOME/.openclaw/skills/bankr/config.json" ]; then key="$(jq -r '.apiKey // empty' "$HOME/.openclaw/skills/bankr/config.json" 2>/dev/null || true)" fi if [ -z "$key" ] && [ -f "$HOME/.openclaw/workspace/skills/bankr/config.json" ]; then key="$(jq -r '.apiKey // empty' "$HOME/.openclaw/workspace/skills/bankr/config.json" 2>/dev/null || true)" fi [ -n "$key" ] || err "BANKR_API_KEY not found in env, systemd, or Bankr config" echo "$key" } ``` Transaction submission sends the recovered credential to the configurable endpoint: ```bash submit_bankr_tx() { local to_address="$1" local calldata="$2" local description="$3" local api_key local payload api_key="$(resolve_bankr_api_key)" payload="$(jq -n \ --arg to "$to_address" \ --arg data "$calldata" \ --arg description "$description" \ '{transaction:{to:$to,chainId:8453,value:"0",data:$data},description:$description,waitForConfirmat ...[truncated 4258 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Pin the production API origin** - Use `https://api.bankr.bot` as a constant in production. - Do not permit ordinary runtime environment variables to redefine the destination that receives credentials. 2. **Allowlist endpoints if overrides are operationally necessary** - Parse the URL and require an exact approved scheme, hostname, and port. - Require HTTPS. - Reject user information, unexpected ports, fragments, and unapproved paths. - Maintain a small explicit allowlist rather than relying on suffix or substring matching. 3. **Separate development behavior** - Permit custom endpoints only when an explicit development or test mode is enabled. - Require separate non-production credentials in that mode. - Emit a clear warning and refuse to load production credentials for custom endpoints. 4. **Harden `curl` invocation** - Require HTTPS with options such as `--proto '=https'`. - Add `--fail-with-body`, `--show-error`, and appropriate connection and request timeouts. - Do not enable credential forwarding across redirects. Prefer rejecting redirects for authenticated API requests. 5. **Reduce credential discovery scope** - Prefer an explicitly provided secret or a dedicated secret-management interface. - Avoid automatically searching multiple configuration locations unless this fallback is essential and clearly documented. - Ensure local credential files have restrictive permissions. 6. **Apply Bankr-side least privilege** - Use narrowly scoped, short-lived, and revocable API credentials where supported. - Require independent confirmation or policy checks for asset transfers. - Rotate the key immediately if endpoint redirection or credential disclosure is suspected. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Ae1

High
Category
analysis-evasion
Content
- `./scripts/pocket-deposit.sh <gotchi-id> <token-alias-or-address> <amount> [--raw]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- `./scripts/pocket-deposit.sh <gotchi-id> <token-alias-or-address> <amount> [--raw]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- `./scripts/pocket-withdraw.sh <gotchi-id> <token-alias-or-address> <to-address> <amount> [--raw]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- `./scripts/pocket-withdraw.sh <gotchi-id> <token-alias-or-address> <to-address> <amount> [--raw]`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Lp3

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding
The skill invokes shell-based scripts and performs blockchain-affecting operations, but the manifest does not declare any explicit tool scope such as permissions or allowed-tools. That creates an authorization ambiguity where an agent or runtime may grant broader shell access than intended, increasing the risk of unintended command execution or transaction-capable actions beyond the documented behavior.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The manifest describes wallet operations on gotchi pockets, but this helper actively searches for credentials in systemd user environment and Bankr config files under the user's home directory. Accessing local credential sources is not explicitly justified by the stated skill purpose and expands the skill's capability into credential discovery.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
This helper submits signed transaction instructions and the API key to an external Bankr endpoint without any built-in confirmation, disclosure, or allowlist enforcement in this file. In a wallet-management skill, external transaction submission is expected, but absent guardrails it can enable unintended on-chain actions if called with attacker-controlled parameters elsewhere in the skill.

External Transmission

Medium
Category
Data Exfiltration
Content
--arg description "$description" \
    '{transaction:{to:$to,chainId:8453,value:"0",data:$data},description:$description,waitForConfirmation:true}')"

  curl -s -X POST "$BANKR_API_URL/agent/submit" \
    -H "X-API-Key: $api_key" \
    -H "Content-Type: application/json" \
    -d "$payload"
Confidence
90% confidence
Finding
The code posts transaction details and an API credential to a remote endpoint, which is an external transmission of sensitive operational data. Given the skill's purpose, some transmission is necessary, but this remains dangerous because compromise or misuse of the remote service could trigger unauthorized asset movement from pocket wallets.

Context-Inappropriate Capability

Medium
Confidence
89% confidence
Finding
The skill sends a plain-English prompt to Bankr to discover the user's wallet address, introducing an unnecessary remote LLM-mediated step for data that should be obtained through a deterministic API or local configuration. This expands the trust boundary, leaks interaction metadata to a third party, and makes ownership checks depend on parsing unstructured remote output.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
if dry_run:
        return 0

    proc = subprocess.run(cmd, text=True, capture_output=True)

    if proc.stdout:
        print(proc.stdout, end="")
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Missing User Warnings

Low
Confidence
92% confidence
Finding
This helper posts a natural-language prompt to the Bankr API and then polls job status using the API key, which is a network operation involving external transmission. The file provides no user-visible warning, prompt, or explanatory comment for this external request behavior.

Static analysis

No suspicious patterns detected.