other
- Location
lib/ai_complexity_predictor.py:42- Finding
Automatic Disclosure of Complete Task Descriptions to OpenRouter
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a real OpenClaw API management tool, but it needs review because it handles provider keys and OpenClaw configuration with unsafe secret-handling and under-disclosed external routing behavior.
Review before installing on any system with real provider keys. Do not pass keys on command lines, avoid rotate_key.sh list/active/rotate with real credentials until outputs are redacted, lock secret files to owner-only permissions, and keep routing local-only for sensitive tasks unless you intentionally allow task text to be sent to OpenRouter.
lib/ai_complexity_predictor.py:42Automatic Disclosure of Complete Task Descriptions to OpenRouter
rotate_key.sh:35Insecure API Credential Storage and Disclosure
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
elif cmd == "test":
# 测试 OpenRouter 连接
r = requests.get(f"{API_BASE}/models",
headers={"Authorization": f"Bearer {API_KEY}"})
if r.status_code == 200:
print(f"✅ OpenRouter API OK, {len(r.json().get('data', []))} models available")
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
elif cmd == "test":
# 测试 OpenRouter 连接
r = requests.get(f"{API_BASE}/models",
headers={"Authorization": f"Bearer {API_KEY}"})
if r.status_code == 200:
print(f"✅ OpenRouter API OK, {len(r.json().get('data', []))} models available")
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
LOG_DIR="${SCRIPT_DIR}/logs"
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
LOG_DIR="${SCRIPT_DIR}/logs"
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
LOG_DIR="${SCRIPT_DIR}/logs"
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
LOG_DIR="${SCRIPT_DIR}/logs"
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
LOG_DIR="${SCRIPT_DIR}/logs"
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
LOG_DIR="${SCRIPT_DIR}/logs"
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
LOG_DIR="${SCRIPT_DIR}/logs"
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
LOG_DIR="${SCRIPT_DIR}/logs"
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
Sourcing a .env file executes it as shell code, not just as data. If an attacker or untrusted process can modify that file, they can achieve arbitrary command execution when this script runs, which is especially dangerous because the file likely contains privileged credentials and may be used by automation.
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
exit 1
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
exit 1
fi
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
exit 1
fi
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
exit 1
fi
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
exit 1
fi
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
exit 1
fi
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
exit 1
fi
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
exit 1
fi
Sourcing the .env file executes it as shell code, not just as data. If an attacker can modify config/.env, they can achieve arbitrary command execution in the context of this script, which is more dangerous than ordinary credential loading.
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found"
exit 1
Sourcing a .env file executes it as shell code, not just as data. If an attacker can modify that file, they can achieve arbitrary command execution in the context of the script and manipulate sensitive variables such as tokens, provider settings, or alert destinations.
# Load environment variables
if [ -f "${CONFIG_DIR}/.env" ]; then
source "${CONFIG_DIR}/.env"
else
echo "Error: ${CONFIG_DIR}/.env not found. Copy .env.example and configure it."
exit 1
The code explicitly prints p['api_key'] in clear text during the list command, directly disclosing sensitive credentials. Because this script manages central server providers, exposed keys may grant access to upstream AI services, enable unauthorized usage, data access, billing abuse, or lateral compromise depending on provider permissions.
The function returns natural-language output containing full API keys, which is a severe secret-handling flaw for an assistant skill. In this context, the skill is explicitly designed for conversational platforms, so exposed keys may be surfaced to end users, stored in chat transcripts, or reused to impersonate the service account.
The provider listing function includes p['api_key'] directly in assistant-facing output, which exposes full secrets to any user or channel able to invoke this helper. In a chat-integrated skill, this is especially dangerous because secrets can be revealed into conversation history, logs, screenshots, or downstream integrations, enabling unauthorized use of the external API accounts.
This line prints stored provider API keys without masking or warning, creating a direct credential disclosure vulnerability. Because the helper is intended for AI assistants in messaging environments, accidental or attacker-induced invocation could leak usable secrets broadly and persistently.
The encrypt() and decrypt() helpers silently fall back to returning plaintext when the key file is missing. This creates a fail-open security condition where callers may believe secrets are being protected even though sensitive values are exposed or stored unencrypted.