T09 · Insecure Skill Coding Practices
- Location
INSTALL.md:32- Finding
Ahrefs API Token Exposed Through Shell History and Terminal Output
- Content
View full analysis
Vulnerability Details
File Location:
INSTALL.md:32-41, 56, 94-95;README.md:81-94;SKILL.md:25-33
Vulnerability Type: Insecure credential handling and plaintext secret disclosure
Risk Level: MediumVulnerable Code
INSTALL.md:32-41:bash Add your API credentials to `~/.openclaw/workspace/.env`: # Linux/Mac echo "AHREFS_API_TOKEN=your_token_here" >> ~/.openclaw/workspace/.env echo "AHREFS_API_PLAN=enterprise" >> ~/.openclaw/workspace/.env # Windows (PowerShell) Add-Content -Path "$env:USERPROFILE\.openclaw\workspace\.env" -Value "AHREFS_API_TOKEN=your_token_here" Add-Content -Path "$env:USERPROFILE\.openclaw\workspace\.env" -Value "AHREFS_API_PLAN=enterprise"INSTALL.md:56andINSTALL.md:94-95:bash grep AHREFS ~/.openclaw/workspace/.envbash # Verify token is set correctly grep AHREFS_API_TOKEN ~/.openclaw/workspace/.envREADME.md:81-94:bash Add your Ahrefs API credentials to `~/.openclaw/workspace/.env`: # Required AHREFS_API_TOKEN=your_api_token_here # Required - Specify your plan tier AHREFS_API_PLAN=enterprise # Options: lite, standard, advanced, enterprise ### Verify Setup grep AHREFS ~/.openclaw/workspace/.envSKILL.md:25-33:bash Add to `~/.openclaw/workspace/.env`: AHREFS_API_TOKEN=your_api_token_here AHREFS_API_PLAN=enterprise # Options: lite, standard, advanced, enterprise # Verify setup grep AHREFS ~/.openclaw/workspace/.envTechnical Analysis
The installation instructions encourage users to substitute a real bearer token directly into an
echoor PowerShellAdd-Contentcommand. The complete command, including the secret, can remain in shell history and may also be captured by terminal recording, audit instrumentation, process monitoring, CI logs, or Agent execution logs.The verification commands then print the token-bearing line from the shared workspace
.envfile. ...[truncated 1634 chars]- Remediation
View remediation
Remediation Suggestions
-
Do not ask users to place real secrets directly in shell command arguments.
-
Prefer the OpenClaw secret-management facility or an operating-system credential store where available.
-
If a file must be used, collect the token through hidden interactive input and write it without echoing it:
bash read -rsp "Ahrefs API token: " AHREFS_TOKEN printf '\n' umask 077 printf 'AHREFS_API_TOKEN=%s\n' "$AHREFS_TOKEN" >> ~/.openclaw/workspace/.env unset AHREFS_TOKEN -
Ensure the credential file is created with owner-only permissions rather than correcting permissions only after the secret has been written:
bash install -m 600 /dev/null ~/.openclaw/workspace/.env -
Replace token-printing verification commands with checks that disclose only status:
bash if grep -q '^AHREFS_API_TOKEN=.\+' ~/.openclaw/workspace/.env; then echo "AHREFS_API_TOKEN is configured" else echo "AHREFS_API_TOKEN is missing" fi -
Avoid logging request headers and redact
Authorizationvalues in Agent, CI, debugging, and support output. -
Recommend rotating the API token if it has already appeared in command history or logs.
-
