T09 · Insecure Skill Coding Practices
- Location
main.py:53- Finding
Etherscan API Key Exposure Through Exception Logging
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a coherent read-only portfolio checker, but users should understand it sends portfolio lookup data to public APIs and has a dependency/API-key logging hygiene issue.
Install only if you are comfortable with the skill reading a local portfolio.json file and sending coin IDs, Ethereum wallet addresses, and an optional Etherscan API key to third-party public APIs. Use a limited Etherscan key, avoid sharing logs from failed runs, and update the requests dependency before production use.
main.py:53Etherscan API Key Exposure Through Exception Logging
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.
## Installation
1. **Create Skill Directory:** Create a new folder named `local-portfolio-auditor` in your ClawBot skills directory (e.g., `~/.openclaw/skills/` or `<project>/skills/`).
2. **Download Files:** Place the `SKILL.md`, `main.py`, `requirements.txt`, and `portfolio.json` files into this new directory.
3. **Install Dependencies:** Navigate to the `local-portfolio-auditor` directory in your terminal and install the required Python packages:
```bash
The documented trigger phrases are very broad and generic, making accidental or overly permissive activation more likely in normal conversation. In an agent setting, weak activation constraints can cause the skill to run on unintended requests and access local financial configuration data or initiate external API calls without sufficiently explicit user intent.
The trigger phrases are generic enough to match ordinary user requests about portfolios, crypto holdings, or stock values, which can cause the skill to activate outside a narrowly intended context. In an agent system, overly broad activation can expose local-file-reading behavior more often than expected and increase the chance of unintended data access or confusing tool selection.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# --- Configuration ---
# API Endpoints (using CoinGecko for crypto, placeholder for stocks)
COINGECKO_API_BASE = "https://api.coingecko.com/api/v3"
# For stocks, a free, reliable API is harder to come by without registration/limits.
# Alpha Vantage is an option, but requires an API key and has rate limits.
# For this example, we'll use a placeholder and emphasize secure API key handling.
The code sends the user's Ethereum address and API key to Etherscan over an external network request. While HTTPS protects the transport, the transmission exposes portfolio-identifying information to a third party and can enable financial profiling if users are unaware of this behavior.
return 1.5 # Dummy balance
try:
url = f"https://api.etherscan.io/api?module=account&action=balance&address={address}&tag=latest&apikey={etherscan_api_key}"
response = requests.get(url, timeout=10)
response.raise_for_status()
data = response.json()
The skill transmits a user's cryptocurrency wallet address to Etherscan to retrieve balances, which is portfolio-related data and can reveal sensitive financial holdings. Although this is functionally required for the feature and uses HTTPS, the main flow does not clearly disclose that user-provided portfolio identifiers will be sent to third-party services, creating a privacy and data-sharing risk.
The file pins requests to version 2.31.0, which is identified by the finding as having multiple published advisories. Shipping a dependency with known security issues is a real supply-chain risk because any code in the skill that performs HTTP requests may inherit flaws such as credential leakage, weakened verification behavior, or unsafe file handling depending on how the library is used.
No suspicious patterns detected.