T09 · Insecure Skill Coding Practices
- Location
get_trakt_token.sh:19- Finding
OAuth Credentials and Tokens Are Exposed in Terminal Input and Output
- Content
View full analysis
Vulnerability Details
File Location:
get_trakt_token.sh:19-22,get_trakt_token.sh:91-113; the same insecure example is reproduced inSKILL.md:251-253andSKILL.md:276-282
Vulnerability Type: Plaintext exposure of authentication credentials
Risk Level: MediumVulnerable Code
bash if [ -z "$TRAKT_CLIENT_SECRET" ]; then echo -n "Enter your Trakt Client Secret: " read TRAKT_CLIENT_SECRET fibash echo "Add these to ~/.openclaw/openclaw.json:" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo '{ "skills": { "entries": { "trakt": { "enabled": true, "env": { "TRAKT_CLIENT_ID": "'"$TRAKT_CLIENT_ID"'", "TRAKT_CLIENT_SECRET": "'"$TRAKT_CLIENT_SECRET"'", "TRAKT_ACCESS_TOKEN": "'"$ACCESS_TOKEN"'", "TRAKT_REFRESH_TOKEN": "'"$REFRESH_TOKEN"'" } } } } }' echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Or export as environment variables:" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo "export TRAKT_CLIENT_ID=\"$TRAKT_CLIENT_ID\"" echo "export TRAKT_CLIENT_SECRET=\"$TRAKT_CLIENT_SECRET\"" echo "export TRAKT_ACCESS_TOKEN=\"$ACCESS_TOKEN\"" echo "export TRAKT_REFRESH_TOKEN=\"$REFRESH_TOKEN\""Technical Analysis
The helper reads
TRAKT_CLIENT_SECRETusing the normalreadcommand, leaving terminal echo enabled. The secret is therefore visibly displayed while the user types it. After completing the OAuth exchange, the script prints the client secret, access token, and refresh token in plaintext.These values can be retained in terminal scrollback, screen recordings, CI logs, remote-session transcripts, support captures, or other console-monitoring systems. The refresh token is particularly sensitive because it can potentially be exchanged for new access toke ...[truncated 1477 chars]
- Remediation
View remediation
Remediation Suggestions
-
Read secrets without terminal echo and restore formatting afterward:
bash read -rsp "Enter your Trakt Client Secret: " TRAKT_CLIENT_SECRET printf '\n' -
Do not print client secrets, access tokens, or refresh tokens to standard output.
-
If automatic configuration is required, request explicit user consent and write the values directly to a configuration file created with restrictive permissions:
bash umask 077 install -m 600 /dev/null "$HOME/.openclaw/openclaw.json" -
Avoid overwriting an existing configuration file without confirmation. Prefer securely merging only the required fields.
-
Redact sensitive values in all success and error messages.
-
Update the helper example in
SKILL.mdso it does not print tokens. -
Warn users not to run credential-generation workflows in recorded terminals or CI environments.
-
Advise users who have already exposed these values to revoke the affected authorization and rotate the client secret and OAuth tokens.
-
