T09 · Insecure Skill Coding Practices
- Location
scripts/send-message.sh:9- Finding
Arbitrary Python Code Execution Through OPENCLAW_JSON
- Content
View full analysis
- Remediation
View remediation
&2 return 1 ;; esac python3 - "$OPENCLAW_JSON" "$1" <<'PY' import json import sys config_path = sys.argv[1] credential_key = sys.argv[2] with open(config_path, encoding="utf-8") as config_file: data = json.load(config_file) print(data["channels"]["feishu"][credential_key]) PY } ``` Additional hardening should include: 1. Validate that the configuration path is absolute and points to an expected configuration directory. 2. Reject symbolic links if the configuration location must be trusted. 3. Verify file ownership and permissions before reading secrets. 4. Run the Skill under a dedicated, unprivileged account rather than `root`. 5. Restrict which environment variables untrusted callers can supply. 6. Keep the explicit allowlist for credential keys so future callers cannot request arbitrary configuration fields. ]]>
