T09 · Insecure Skill Coding Practices
- Location
references/docker-compose-env-example.md:24- Finding
Cloudflare API Token Disclosure Through Verification Command
- Content
View full analysis
Vulnerability Details
File Location:
references/docker-compose-env-example.md, lines 24–26
Vulnerability Type: Credential exposure through insecure operational guidance
Risk Level: MediumVulnerable Code Snippet
bash docker compose exec openclaw env | grep '^CF_'text Expected output should include both variables.Technical Analysis
The documented verification command prints the complete values of every environment variable whose name begins with
CF_, includingCF_API_TOKEN. Verifying that credentials are configured does not require disclosing their values.Because the command writes secrets to standard output, the API token may be captured in terminal history or scrollback, CI/CD logs, screen recordings, support transcripts, or an agent conversation context. Although the Python scripts do not print the token, this documentation instructs users to expose it through an avoidable diagnostic step.
Attack Path
- An operator configures
CF_ACCOUNT_IDandCF_API_TOKENin the OpenClaw container. - The operator follows the documented verification command.
- The container prints the complete Cloudflare account identifier and bearer token.
- The output is retained in a CI log, terminal recording, support transcript, or conversation context.
- An unauthorized party with access to that output extracts the token.
- The party submits authenticated requests to Cloudflare using the permissions granted to the exposed token.
Impact Assessment
An attacker could consume Workers AI resources and perform actions authorized by the exposed token. The exact scope is bounded by the token's Cloudflare account permissions; impact increases if the token was not restricted to the minimum Workers AI inference permission. The issue does not itself grant local system privileges or permissions beyond those already assigned to the token.
The separately flagged base64 encoding in ` ...[truncated 237 chars]
- An operator configures
- Remediation
View remediation
Remediation Suggestions
Replace the value-printing command with a presence-only check that never emits credential contents:
bash docker compose exec openclaw sh -c ' for name in CF_ACCOUNT_ID CF_API_TOKEN; do eval "value=\${$name:-}" if [ -n "$value" ]; then echo "$name=set" else echo "$name=missing" fi done 'Additionally:
- Explicitly warn users not to print, paste, or log
CF_API_TOKEN. - Use a Cloudflare API token restricted to the target account and the minimum Workers AI inference permission.
- Mask secret environment variables in CI/CD systems.
- Revoke and rotate any token that may already have appeared in logs or transcripts.
- Review retained logs and support records for accidental exposure and restrict or remove them where possible.
- Explicitly warn users not to print, paste, or log
