T09 · Insecure Skill Coding Practices
- Location
config/config.yaml:5- Finding
Hard-coded cloud API and privileged SSH credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill’s YARN analysis purpose is understandable, but it ships real-looking cloud and root SSH credentials and uses them in unsafe ways.
Do not install or run this skill as-is. Treat the included cloud key and root SSH password as exposed, rotate them, remove hard-coded secrets, require a non-root read-only account, enable SSH host-key verification, and replace the custom cloud authentication with the official provider SDK or signed requests.
config/config.yaml:5Hard-coded cloud API and privileged SSH credentials
scripts/analyze_yarn.py:105Raw cloud secret transmitted through a nonstandard authorization header
scripts/analyze_yarn.py:150SSH host identity verification is disabled
scripts/analyze_yarn.py:229SSH collection exceeds the minimum privileges required for YARN analysis
The documented purpose is YARN resource analysis, but the skill behavior includes sensitive remote access via SSH, use of cloud access keys for direct API calls, local cookie/log persistence, and host-level/HDFS data collection beyond the stated scope. This mismatch is dangerous because operators may authorize the skill for a narrow diagnostic task while it actually performs broader privileged actions and handles secrets, creating risk of credential leakage, excessive collection, and trust bypass.
The skill documents capabilities that require file access, local persistence, SSH, and external API/network use, but it declares no explicit tool scope or permission boundaries. This is dangerous because an agent/runtime may grant broader access than users expect, increasing the chance of over-privileged execution and unintended data exposure.
L023 明确写明“禁止读取外部文件或依赖外部脚本”,属于对实现边界的主动声明。但后文 L080 和 L090 使用 ~/.openclaw/workspace/... 的外部绝对路径来执行脚本和读取日志,且 L062/L083 也表明脚本会读取配置文件,因此该文档表述与实际预期运行方式相矛盾。
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
## 安全注意事项
1. **配置文件安全** - `config.yaml` 包含敏感信息,建议设置权限 `chmod 600 config/config.yaml`
2. **Cookie 存储** - `data/cookies.json` 仅 Skill 自身可读写
3. **日志脱敏** - 不记录完整的 AccessKey Secret
4. **最小权限** - 使用只读账号进行分析
The natural-language comments in this file are entirely in Chinese, which imposes a specific language expectation on users without offering an alternative or documenting why the locale is required. This can violate language or locale policy when no user opt-in or region-specific justification is provided in the file.
The file’s user-facing natural-language content, including the module description and all logs/comments, is written exclusively in Chinese, which imposes a specific language/locale choice. There is no indication that the user can select a language or that the skill is intended only for a Chinese-specific compliance or regional context.
The script stores and reloads cookie data locally despite the stated YARN analysis workflow not requiring browser/session cookies. Unnecessary persistence of authentication artifacts increases the chance of credential leakage from disk, log correlation, or reuse by other local processes, especially because the file is kept for 24 hours and there is no protection, encryption, or scope validation.
The script sends sensitive cloud credentials and SSH credentials over the network without any user-facing disclosure, and the EMR API authentication is implemented as a custom Authorization header carrying access key ID and secret together. This is dangerous because it mishandles secrets, increases the blast radius of interception or logging, and deviates from standard cloud SDK signing practices that provide stronger request authentication controls.
The external HTTP POST sends cluster identifiers and credentials-derived authentication material to a remote endpoint. External transmission is expected for an EMR-integrated skill, but it still represents a real data-exposure surface, especially here because the request construction appears custom and may send more sensitive material than necessary.
try:
logger.info(f"调用 API: {endpoint}")
response = requests.post(
url,
json=payload,
headers=headers,
The skill performs remote shell command execution over SSH, including as root by default, without explicit warning or consent flow. Even if the current commands are read-oriented, this grants powerful remote access and materially increases risk if configuration is altered, the host is malicious, or command content later becomes user-influenced.
The data collection goes beyond YARN resource analysis and also gathers host memory, CPU, load, and HDFS report data. This violates least-privilege and data-minimization expectations for the advertised skill, potentially exposing unrelated system inventory and storage details that could aid reconnaissance if the output, logs, or downstream consumers are compromised.
L136 将“本地存储”效果描述为“无网络依赖”,但技能描述 L003、L008 以及错误处理 L145-L146 都明确说明其通过 SSH 和 EMR API 工作,并会因网络问题失败。这不是简单遗漏,而是对技能依赖条件的直接反向表述。
This YAML manifest says 'all parameters can be modified here' without clarifying which changes are safe, required, or out of scope. In a manifest file, this kind of broad instruction can create ambiguous trigger/scope expectations for how the skill should be configured and when particular settings should be changed.