T09 · Insecure Skill Coding Practices
- Location
index.js:72- Finding
API Keys Are Stored in a Plaintext File Without Restrictive Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly coherent, but it handles API keys with weak local safeguards and overstates how safely they are stored.
Review this before installing if you plan to store real API keys. Prefer a dedicated secret manager or OS keychain, avoid passing keys on the command line, manually protect or ignore .openclaw/.env, and verify any npm install commands from the providers' official documentation.
index.js:72API Keys Are Stored in a Plaintext File Without Restrictive Permissions
index.js:267API Keys Can Be Passed Through Process Command-Line Arguments
references/codex-openai.md:25Documentation Recommends Unpinned Third-Party npm Installations
The skill combines API key management, status inspection, and rotation workflows while presenting itself as a planning assistant. For a secret-handling tool, misleading framing is especially risky because users may not apply the scrutiny they would to a credential manager, making accidental disclosure or unauthorized changes more likely.
The skill combines API key management, status inspection, and rotation workflows while presenting itself as a planning assistant. For a secret-handling tool, misleading framing is especially risky because users may not apply the scrutiny they would to a credential manager, making accidental disclosure or unauthorized changes more likely.
The skill combines API key management, status inspection, and rotation workflows while presenting itself as a planning assistant. For a secret-handling tool, misleading framing is especially risky because users may not apply the scrutiny they would to a credential manager, making accidental disclosure or unauthorized changes more likely.
The skill combines API key management, status inspection, and rotation workflows while presenting itself as a planning assistant. For a secret-handling tool, misleading framing is especially risky because users may not apply the scrutiny they would to a credential manager, making accidental disclosure or unauthorized changes more likely.
The skill is designed to access a local .env file containing multiple API keys, which is direct interaction with highly sensitive credentials. Even if the docs mention masking and .gitignore, centralizing read/write/rotation of secrets inside a broadly described skill creates substantial risk of exfiltration, accidental disclosure, or unauthorized overwrite if triggered improperly.
# .openclaw/.env
GITHUB_COPILOT_TOKEN=ghp_xxxx...xxxx
CLAUDE_API_KEY=sk-ant-xxxx...xxxx
OPENAI_API_KEY=sk-xxxx...xxxx
Referenced artifact was not completely inspected
### scripts/check-status.js
Referenced artifact was not completely inspected
### scripts/check-status.js
Referenced artifact was not completely inspected
### scripts/rotate-key.js
Referenced artifact was not completely inspected
### scripts/rotate-key.js
Referenced artifact was not completely inspected
1. 鍦?`config.json` 涓坊鍔犲钩鍙伴厤缃?2. 鍦?`references/` 涓垱寤哄畼鏂规枃妗i摼鎺?3. 鏇存柊 `SKILL.md` 鐨勫钩鍙版竻鍗?
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
},
"security": {
"envPath": ".openclaw/.env",
"maskPattern": "...***",
"rotationReminder": "90 天"
},
The skill is explicitly designed to access a shared .openclaw/.env path under the invoking working directory, creating a capability to read and later expose whether credentials exist across platforms. In agent ecosystems, direct filesystem access to secret files is sensitive because it can be repurposed to enumerate or misuse credentials outside a narrowly scoped secret-management boundary.
// 技能目录
const SKILL_DIR = __dirname;
const CONFIG_PATH = path.join(SKILL_DIR, 'config.json');
const ENV_PATH = path.join(process.env.INIT_CWD || process.cwd(), '.openclaw', '.env');
// 加载配置
let config = {};
getCredential reads raw secret values from .env and returns them to the application, enabling the skill to inspect stored credentials. Even though status output masks previews, the underlying function still exposes full secret material to code paths, which is dangerous if the skill is extended, misused, or invoked by another component.
}
/**
* 读取 .env 文件中的凭据
* @param {string} keyName - 环境变量名
* @returns {string|null} - 凭据值或 null
*/
saveCredential persists API keys in plaintext to .openclaw/.env, which is a sensitive credential-access and credential-storage behavior. In the skill context, this is more dangerous because the component is framed as a general assistant workflow helper, yet it handles secrets on disk without encryption, permission hardening, or safer storage primitives.
}
/**
* 保存凭据到 .env 文件
* @param {string} keyName - 环境变量名
* @param {string} keyValue - 凭据值
* @returns {boolean} - 是否成功
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# 闃块噷浜戠櫨鐐?Qwen Code 瀹樻柟璧勬簮
## 瀹樻柟缃戠珯
- **鐧剧偧鎺у埗鍙?*: https://bailian.console.aliyun.com
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# 闃块噷浜戠櫨鐐?Qwen Code 瀹樻柟璧勬簮
## 瀹樻柟缃戠珯
- **鐧剧偧鎺у埗鍙?*: https://bailian.console.aliyun.com
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# 闃块噷浜戠櫨鐐?Qwen Code 瀹樻柟璧勬簮
## 瀹樻柟缃戠珯
- **鐧剧偧鎺у埗鍙?*: https://bailian.console.aliyun.com
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# 闃块噷浜戠櫨鐐?Qwen Code 瀹樻柟璧勬簮
## 瀹樻柟缃戠珯
- **鐧剧偧鎺у埗鍙?*: https://bailian.console.aliyun.com
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# 闃块噷浜戠櫨鐐?Qwen Code 瀹樻柟璧勬簮
## 瀹樻柟缃戠珯
- **鐧剧偧鎺у埗鍙?*: https://bailian.console.aliyun.com
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# 闃块噷浜戠櫨鐐?Qwen Code 瀹樻柟璧勬簮
## 瀹樻柟缃戠珯
- **鐧剧偧鎺у埗鍙?*: https://bailian.console.aliyun.com
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
# 闃块噷浜戠櫨鐐?Qwen Code 瀹樻柟璧勬簮
## 瀹樻柟缃戠珯
- **鐧剧偧鎺у埗鍙?*: https://bailian.console.aliyun.com
The README describes the skill only as a general coding-plan assistant, but the actual documented behaviors include credential collection, storage in .openclaw/.env, registration guidance, pricing comparison, and purchase-related workflows. This mismatch reduces informed consent and makes it easier for users or invoking systems to authorize a skill without understanding that it handles secrets, which raises the risk of unsafe credential exposure or unintended privileged actions.
The credential-configuration flow is invoked by ordinary speech ('配置 GitHub Copilot') and immediately instructs the user to provide an API key for storage. Because this is a secret-handling capability, ambiguous activation is more dangerous in context: a routine conversation could transition into credential intake without strong user intent verification, leading to accidental disclosure of sensitive tokens to the agent or wrong skill.
The natural-language triggers are broad conversational phrases such as '帮我注册 Claude Code' and '配置 GitHub Copilot' without clear activation boundaries or confirmation requirements. In an agent environment, generic phrases can cause accidental invocation of sensitive flows like registration or credential handling when the user intended only to ask a question, increasing the chance of unintended collection or modification of secrets.
The skill documents capability to read and manage API keys from .openclaw/.env, but the manifest declares no explicit tool scope or permissions. That mismatch weakens user consent and reviewability because a credential-handling skill can access sensitive local state without clearly advertising that need up front.