T09 · Insecure Skill Coding Practices
- Location
scripts/preview.sh:10- Finding
Configuration Preview Fails to Redact API Keys, Tokens, Passwords, and Secrets
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is intended to help edit OpenClaw configuration, but its advertised redaction is broken and can expose API keys or tokens while claiming the output is safe.
Review carefully before installing. Do not share output from this skill's preview or sanitize scripts, and assume any credentials processed by the current redaction commands may be exposed in terminal output or logs. The edit workflow should use structural jq-based redaction, a minimal non-sensitive diff, a secure temporary file in the config directory, and clear user confirmation before modifying or restarting OpenClaw.
scripts/preview.sh:10Configuration Preview Fails to Redact API Keys, Tokens, Passwords, and Secrets
scripts/sanitize.sh:5Standalone Sanitizer Does Not Redact Most Advertised Sensitive Fields
SKILL.md:77Predictable Temporary File Enables Symlink-Based File Overwrite
声明描述的核心能力是“安全修改”配置文件,且强调修改前备份、脱敏预览、并获得用户确认。但实际代码是一个 preview.sh 预览脚本,只读取配置文件并输出部分字段和完整配置的脱敏版本,没有任何写入、备份、差异预览后的确认交互或应用修改逻辑。因此其实际行为只覆盖了声明中的一个辅助环节(预览/部分脱敏),与声明的主要用途存在实质不符。虽然代码没有表现出额外越权或危险能力,但其主功能明显弱于且不同于声明的完整安全修改流程。
The declared description presents a full safe configuration-editing skill for OpenClaw, with file modification, backup, preview, and user confirmation. The supplied code only implements one narrow supporting function: masking sensitive values in JSON streamed through stdin. That behavior is related to the declared preview/redaction aspect, but it does not fulfill the primary declared purpose of safely modifying the OpenClaw config file. Because the actual code’s primary behavior is materially narrower and different from the declared end-to-end modification workflow, this is a mismatch.
声明描述的核心能力是“安全修改配置文件”,并明确包含修改、备份、预览和确认等流程。但提供的代码仅做静态校验和信息输出,属于配置验证工具,而不是配置修改工具。其主要目的与声明明显不一致,且缺少声明中强调的关键安全修改步骤,因此应判定为描述与行为不匹配。
The manifest description is written as an unconditional Chinese-language instruction, and the confirmation flow later requires a Chinese-only exact phrase. This imposes a language constraint on all users without documenting an opt-in or offering an alternative locale, which matches the policy's language/locale violation criterion.
The documented connectivity test sends a network request to an external service, which creates outbound transmission from a skill intended for local configuration handling. Even though the example uses a test bearer token, invoking external requests during validation can leak metadata such as IP, timing, environment usage patterns, or accidentally real credentials if operators adapt the command unsafely.
~/.openclaw/skills/safe-config/scripts/validate.sh
curl -s https://api.siliconflow.cn/v1/models -H "Authorization: Bearer test" | jq .
### 步骤 3: 请求用户确认
Requiring a single exact Chinese phrase for confirmation creates a brittle confirmation control that can cause operators to bypass or mis-handle approval steps, especially in multilingual environments. A safety-critical confirmation mechanism should be unambiguous and accessible; otherwise users may resort to ad hoc workarounds that weaken the intended authorization check.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"models": {
"providers": {
"anthropic": {
"baseUrl": "https://api.anthropic.com/v1",
"apiKey": "sk-ant-***",
"models": [
{
The user-facing natural-language fields are written entirely in Chinese, including the required confirmation phrase, with no indication that another language is supported or that the skill is region-specific. This creates a language/locale policy issue because it imposes a specific language on users without opt-in or justification.
This markdown file presents all instructions and examples in Chinese only, with no indication that the user can choose another language. Under the policy for natural-language violations, forcing a specific language without user opt-in is reportable unless the locale constraint is explicitly documented and justified.
The script's comments, usage text, and terminal output are written entirely in Chinese, which forces a specific language for users regardless of locale. The policy allows fixed-language behavior only when users are given a choice or the locale restriction is clearly documented and justified, which is not present here.
The script prints broad portions of a user’s OpenClaw configuration, including metadata, provider names, channel/plugin state, and a full JSON dump after only partial redaction. The redaction logic is incomplete and brittle, so secrets under other key names or nested formats may still be exposed to the terminal, logs, scrollback, or screen sharing; in the context of a skill specifically intended to inspect and modify ~/.openclaw/openclaw.json, this increases the likelihood of sensitive disclosure.
This shell script uses Chinese-only comments and user-facing messages throughout, such as the usage text and validation results. For a general-purpose validation skill, forcing a specific language without opt-in or a documented region-specific justification is a natural-language locale policy violation.
No suspicious patterns detected.