T09 · Insecure Skill Coding Practices
- Location
SKILL.md:105- Finding
Plaintext API Credential Collection, Storage, and Disclosure
- Content
View full analysis
Vulnerability Details
File Locations:
SKILL.md:33SKILL.md:105-122SKILL.md:227-229SKILL.md:237-251SKILL.md:290references/openclaw-config-reference.md:49-53
Vulnerability Type: Plaintext sensitive-data handling
Risk Level: MediumVulnerable Code Snippets
SKILL.md:105-122presents shell startup files and the OpenClaw configuration as locations for plaintext credentials:bash export PROVIDER_API_KEY="sk-xxxxx"json { "env": { "PROVIDER_API_KEY": "sk-xxxxx" } }SKILL.md:227-229recommends displaying the complete credential in terminal output:bash echo $PROVIDER_API_KEYSKILL.md:237-251provides additional plaintext multi-key examples:json { "env": { "PROVIDER_API_KEY_1": "sk-xxx1", "PROVIDER_API_KEY_2": "sk-xxx2", "PROVIDER_API_KEY_3": "sk-xxx3" } }bash export PROVIDER_API_KEYS="sk-xxx1,sk-xxx2,sk-xxx3"references/openclaw-config-reference.md:49-53embeds an API credential directly in configuration:json "env": { "ENV_VAR": "actual-api-key" }The workflow also directs the agent to collect an API key from the user at
SKILL.md:33and describes the user as providing the key atSKILL.md:290.Technical Analysis
API keys are bearer credentials. Any party that obtains a key can generally exercise the permissions assigned to it without additional authentication.
The skill correctly uses environment-variable references in some provider examples, but it also instructs users to place actual credentials in shell initialization files or the OpenClaw JSON configuration. These are persistent plaintext locations and can be exposed through configuration backups, source-control mistakes, diagnostic bundles, broad file permissions, or other local processes and users.
Requesting that the user provide a raw API key to the agent can additionally ...[truncated 1839 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not ask users to paste raw API keys into chat. Instruct them to provision credentials locally outside the agent conversation.
- Generate configuration containing only indirect references such as:
json { "apiKey": "${PROVIDER_API_KEY}" } - Remove examples that place real credentials in the OpenClaw
envobject or shell startup files. Prefer an operating-system secret store, a dedicated secrets manager, or OpenClaw's documented secure credential mechanism. - Replace
echo $PROVIDER_API_KEYwith a non-disclosing presence check, such as:bash if [ -n "${PROVIDER_API_KEY:-}" ]; then printf '%s\n' "PROVIDER_API_KEY is set" else printf '%s\n' "PROVIDER_API_KEY is not set" fi - If a local credential file is unavoidable, require restrictive permissions such as
chmod 600, exclude it from source control and routine support bundles, and clearly document the residual plaintext-storage risk. - Ensure generated backups do not contain credentials. If secret-bearing backups already exist, delete them securely where feasible and rotate the affected keys.
- Redact credentials from logs, command output, validation errors, screenshots, and diagnostic reports.
- Recommend narrowly scoped provider keys, spending limits, expiration where supported, regular rotation, and immediate revocation after suspected exposure.
