T09 · Insecure Skill Coding Practices
- Location
SKILL.md:97- Finding
Access Token Exposed Through Terminal Output
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 97–99
Vulnerability Type: Credential exposure through plaintext output
Risk Level: Mediumbash export KNOWLEDGE_TOKEN="your-access-token" echo $KNOWLEDGE_TOKENTechnical Analysis
The setup instructions explicitly print
KNOWLEDGE_TOKENto standard output. Although the example uses a placeholder, users following the documented sequence after assigning a real token will disclose that credential in plaintext.Standard output may be retained in terminal scrollback, shell-session recordings, CI/CD logs, Agent execution transcripts, remote support sessions, or observability systems. Environment-variable storage does not protect a credential once its value is printed.
Attack Path
- A user assigns a valid service credential to
KNOWLEDGE_TOKEN. - The user or Agent follows the setup instructions and executes
echo $KNOWLEDGE_TOKEN. - The complete credential is written to standard output.
- Terminal output is retained in an Agent transcript, execution log, recording, or monitoring system.
- An unauthorized party with access to that output extracts the token.
- The party reuses the token against the associated knowledge service until it expires or is revoked.
Impact Assessment
An attacker could obtain the privileges granted to the exposed knowledge-service token. Depending on server-side authorization, this may permit unauthorized queries, consumption of the victim's quota, access to account-scoped data, or impersonation of the token owner.
The issue does not directly provide local system privileges. Its scope is limited by the permissions, lifetime, and server-side restrictions of the disclosed token.
- A user assigns a valid service credential to
- Remediation
View remediation
Remediation Suggestions
Remove the command that prints the token. Verify only whether the variable is populated:
bash if [ -n "${KNOWLEDGE_TOKEN:-}" ]; then echo "Knowledge token is configured" else echo "Knowledge token is not configured" fiAdditional hardening measures:
- Ensure debug logs and execution traces redact authentication headers and token values.
- Use short-lived, narrowly scoped credentials where supported.
- Prevent secrets from being included in Agent responses or execution logs.
- Document an immediate token-rotation procedure for accidental disclosure.
- Prefer a platform secret manager over manual environment-variable entry when available.
