T09 · Insecure Skill Coding Practices
- Location
scripts/validate_openclaw_env.py:218- Finding
Malformed Environment Lines Can Disclose Credentials Through Validation Output
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly coherent for OpenClaw operations, but its helper scripts can expose sensitive .env contents and allow misleading ledger entries.
Review this skill before installing in production workflows. It is not malicious, but users should avoid running the env validator where output is logged until malformed-line redaction is fixed, and should only pass trusted values to the ledger updater or store ledger records in a structured/sanitized format.
scripts/validate_openclaw_env.py:218Malformed Environment Lines Can Disclose Credentials Through Validation Output
scripts/update_openclaw_ops_ledger.py:43Unescaped Ledger Fields Permit Persistent Markdown Content Injection
The declared description suggests a broad operational/deployment skill for OpenClaw, including secure deployment, runtime hardening, integration setup guidance, migration support, and incident response workflows. The supplied code chunk instead implements a narrow logging utility: it parses CLI flags, validates a date, ensures a ledger file exists, and appends a formatted markdown entry describing an event. This is materially different from the declared primary purpose. While ledgering could support operations workflows, this code does not itself provide deployment, hardening, troubleshooting, migration, or environment management functionality. Therefore the description does not accurately represent this code chunk’s actual behavior.
The declared description presents a comprehensive OpenClaw deployment and operations skill covering installation, hosting across multiple providers, secure defaults, onboarding, troubleshooting, migration, tuning, and incident response. The supplied code does not implement those capabilities. Instead, it is a single validation script focused specifically on checking .env configuration files against profile-specific key requirements and simple secret-quality heuristics. While env validation and a small amount of configuration hardening support the broader deployment domain, the actual code chunk’s primary purpose is much narrower and materially different from the declared skill scope. This is therefore a description-behavior mismatch.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"- [ ] Append `scope_lock` entry to ops ledger.",
"",
"## 2. Preflight Validation",
f"- [ ] Validate `.env` with `scripts/validate_openclaw_env.py --env-file .env --profile {profile}`.",
"- [ ] Block progression on any validation failure.",
"- [ ] Append `predeploy_validation` entry to ops ledger.",
"",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"- [ ] Append `scope_lock` entry to ops ledger.",
"",
"## 2. Preflight Validation",
f"- [ ] Validate `.env` with `scripts/validate_openclaw_env.py --env-file .env --profile {profile}`.",
"- [ ] Block progression on any validation failure.",
"- [ ] Append `predeploy_validation` entry to ops ledger.",
"",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"- [ ] Append `scope_lock` entry to ops ledger.",
"",
"## 2. Preflight Validation",
f"- [ ] Validate `.env` with `scripts/validate_openclaw_env.py --env-file .env --profile {profile}`.",
"- [ ] Block progression on any validation failure.",
"- [ ] Append `predeploy_validation` entry to ops ledger.",
"",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"- [ ] Append `scope_lock` entry to ops ledger.",
"",
"## 2. Preflight Validation",
f"- [ ] Validate `.env` with `scripts/validate_openclaw_env.py --env-file .env --profile {profile}`.",
"- [ ] Block progression on any validation failure.",
"- [ ] Append `predeploy_validation` entry to ops ledger.",
"",
The skill instructs file-writing behavior via the operations ledger and references helper scripts that update local files, but it does not declare any explicit tool scope or allowed-tools boundaries. That omission weakens least-privilege controls and makes it easier for a consuming agent to perform unintended filesystem actions beyond what operators expect.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
| Infra ownership | Local machine/WSL resources | Cloud account + provider runtime |
| Exposure defaults | Private-first | Provider ingress with explicit auth controls |
| Required profile | `local` | `hosted-fly`, `hosted-render`, `hosted-railway`, `hosted-hetzner`, `hosted-gcp` |
| Rollback model | Restore local config/state snapshot | Redeploy prior revision + restore persisted state |
## Decision Rules
1. If user wants minimal setup and no cloud account, prefer `local`.
No suspicious patterns detected.