T09 · Insecure Skill Coding Practices
- Location
scripts/macro_data.py:51- Finding
API Keys May Be Disclosed Through Raw Exception Output
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This finance data skill is mostly purpose-aligned, but it needs review because optional API keys can be exposed through raw error output despite documentation claiming sensitive data is safely redacted.
Review before installing if you plan to configure paid or quota-limited API keys. Prefer a pinned or verified installer, avoid running install commands with elevated privileges, and treat any API key that appears in logs or transcripts as exposed. The skill does not appear to trade, access financial accounts, persist background code, or perform unrelated local data collection.
scripts/macro_data.py:51API Keys May Be Disclosed Through Raw Exception Output
README.md:25Recommended Unpinned npx Installation Executes Mutable Third-Party Code
scripts/yahoo_finance.py:1Yahoo Finance Module Imports an Undeclared and Unused Third-Party Dependency
The README instructs users to run npx clawhub install fin-intel-hub without pinning a specific clawhub version. This creates a supply-chain risk because npx will fetch the latest package at execution time, so a compromised, typosquatted, or malicious future release could execute arbitrary code on the user's system during installation. In a skill-installation context, this is more dangerous because users are explicitly encouraged to run the command locally.
This markdown file is entirely presented in Simplified and Traditional Chinese, with no English or explicit user-selectable language option in the document itself. The policy for natural-language violations applies to all file types and flags cases where a skill enforces a specific language without user opt-in.
The README instructs users to run npx clawhub install fin-intel-hub without pinning a specific clawhub version. Because npx resolves and executes the latest published package by default, a compromised upstream package, typo-squatted replacement, or breaking update could cause users to run unintended code during installation.
This is a second unpinned npx clawhub execution path in the Traditional Chinese installation section. It carries the same supply-chain risk: users may execute whatever version is currently served, including a malicious or compromised release, directly on their system.
The skill description explicitly includes a catch-all trigger for 'any financial data research and analysis tasks,' which is broader than the concrete capabilities listed elsewhere. Overly broad routing language can cause the agent to invoke this skill for loosely related requests, increasing the chance of unnecessary external data access, unexpected behavior, or the skill being selected in contexts it was not designed to handle safely.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
end_date = datetime.now()
start_date = end_date - timedelta(days=days)
url = "https://api.glassnode.com/v1/metrics/flows/exchange_inflow"
params = {
"a": "BTC",
"s": int(start_date.timestamp()),
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"""Fallback: Get exchange data from CoinGecko (limited but free)."""
try:
# CoinGecko exchange volume data as proxy
url = "https://api.coingecko.com/api/v3/exchanges"
response = self.session.get(url, timeout=10)
if response.status_code != 200:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"""Fallback: Get exchange data from CoinGecko (limited but free)."""
try:
# CoinGecko exchange volume data as proxy
url = "https://api.coingecko.com/api/v3/exchanges"
response = self.session.get(url, timeout=10)
if response.status_code != 200:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"""
try:
if protocol:
url = f"https://api.llama.fi/protocol/{protocol.lower()}"
else:
url = "https://api.llama.fi/charts"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"""
try:
if protocol:
url = f"https://api.llama.fi/protocol/{protocol.lower()}"
else:
url = "https://api.llama.fi/charts"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if not etherscan_key:
# Fallback to public gas tracker
try:
url = "https://api.etherscan.io/api"
params = {
"module": "gastracker",
"action": "gasoracle",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
try:
# Whale Alert API integration would go here
# https://api.whale-alert.io/v1/transactions
pass
except Exception as e:
print(f"Whale alert error: {e}")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
class FREDClient:
"""Client for fetching macroeconomic data from FRED (Federal Reserve Economic Data)."""
BASE_URL = "https://api.stlouisfed.org/fred"
def __init__(self, api_key: Optional[str] = None):
"""
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if not cik:
return []
url = f"https://data.sec.gov/api/xbrl/companyfacts/CIK{cik}.json"
try:
response = self.session.get(url, timeout=15)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if not cik:
return []
url = f"https://data.sec.gov/api/xbrl/companyfacts/CIK{cik}.json"
try:
response = self.session.get(url, timeout=15)
This is a real information disclosure weakness. Although the logger sanitizes only the explicit message string, the code returns raw exception text to callers for RateLimitExceeded and ValidationError via {"error": str(e) ...}, and those exceptions may contain user input, URLs, tokens, or upstream error details. In a finance-data skill that handles API calls and external inputs, this can leak sensitive operational details or attacker-supplied content into user-visible responses and logs.
The request parameters hard-code "language": "en", which constrains the skill to English content regardless of user preference. This is a natural-language/locale policy concern because the file provides no user choice, opt-in, or documented region-specific justification for the restriction.
This code reads sensitive API keys from environment variables and sends them in outbound HTTP requests, but provides no confirmation prompt or user-facing disclosure before transmitting them. Although the docstrings mention API usage, they do not clearly warn that locally configured credentials will be attached to requests.
No suspicious patterns detected.