T09 · Insecure Skill Coding Practices
- Location
lib/kraken_validate.sh:3- Finding
Private API credentials and WebSocket tokens can be redirected to attacker-controlled hosts
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Kraken trading skill is purpose-aligned, but it needs review because raw and configurable interfaces can weaken safeguards around account-changing API calls and authentication material.
Install only after reviewing the raw private and WebSocket workflows. Use least-privilege Kraken API keys, prefer read-only keys unless trading is required, avoid untrusted OPENCLAW_KRAKEN_CONFIG files, keep endpoint variables pinned to official Kraken hosts, and do not route command output containing challenge signatures into logs or shared transcripts.
lib/kraken_validate.sh:3Private API credentials and WebSocket tokens can be redirected to attacker-controlled hosts
bin/openclaw-kraken:157Raw private API interfaces bypass state-change confirmation controls
lib/kraken_config.sh:3Configuration loading executes arbitrary shell code
bin/openclaw-kraken:325Futures WebSocket challenge command prints authentication material to stdout
The declared purpose centers on Kraken exchange operations via a Bash CLI, including API queries, account inspection, trading/funding actions, and websocket payload handling. The actual code chunk does none of these things. It is a packaging/release helper script for versioning and publishing the skill itself. This is a materially different primary purpose, with unrelated capabilities and resources, so it should be flagged as a mismatch.
The declared description describes a full-featured Kraken trading/account CLI. The provided code chunk is only a small support script that outputs a constant nonce, likely for testing. This behavior is materially narrower and unrelated to the declared primary purpose when evaluated in isolation, so the description does not accurately represent what this specific code chunk actually does.
The skill exposes shell-based operational capability but does not declare any explicit tool scope or permissions boundary. In an agent ecosystem, that increases the chance the skill can be invoked with broader-than-expected execution privileges, making misuse or unintended command execution harder to constrain and audit.
The script executes whatever command string is referenced by the KRAKEN_NONCE_CMD environment variable. Because this file operates in a high-value context with API credentials and trading capabilities, an attacker who can influence the environment can trigger arbitrary command execution, potentially leading to secret theft, unauthorized trades, or broader host compromise.
The function reads KRAKEN_API_SECRET and transforms it for signing, which is access to sensitive credentials. In this file there is no confirmation, logging, comment, or docstring disclosing that credential material is being consumed.
The function sources a Bash file from the environment-controlled OPENCLAW_KRAKEN_CONFIG path, which causes arbitrary shell code in that file to execute in the current process. In a skill that manages trading actions and secrets, this is especially dangerous because a malicious config can exfiltrate API credentials, alter endpoints, disable safeguards, or execute arbitrary commands before any business logic runs.
The skill implicitly trusts and sources a config file specified by an environment variable without clear disclosure, making behavior depend on hidden ambient state. This increases the chance that users or calling systems unknowingly execute attacker-controlled configuration, particularly in automated environments where environment variables may be inherited or injected.
For signed requests, the function reads sensitive environment variables and sends authentication headers over the network, but this shell file provides no confirmation prompt and no user-facing disclosure in comments or docstrings near the behavior. This matches the missing-warning criterion for code files because it handles credentials and transmits them externally.
The request helper supports state-changing HTTP methods that can modify or cancel futures resources, yet there is no confirmation prompt or inline user disclosure here describing that such operations may be irreversible or account-affecting. Although the skill may be intended for exchange operations, this file alone does not visibly warn users about these safety-critical actions.
No suspicious patterns detected.