T09 · Insecure Skill Coding Practices
- Location
SKILL.md:271- Finding
API Token Exposure Through Troubleshooting Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 271
Vulnerability Type: Secret exposure through terminal output
Risk Level: MediumVulnerable Code Snippet
markdown > Self-check: In most cases, `GUAIKEI_API_TOKEN` did not pass validation (see Q1). Before running, use `echo $GUAIKEI_API_TOKEN` to confirm that the variable has been injected.The original instruction executes:
sh echo $GUAIKEI_API_TOKENTechnical Analysis
The troubleshooting instruction prints the complete
GUAIKEI_API_TOKENvalue to standard output. Confirming that an environment variable is present does not require disclosing its value.Terminal output may be retained in CI/CD logs, agent tool transcripts, shell-session recordings, shared diagnostic output, screenshots, or screen-sharing sessions. The implementation itself does not log the token, but this documentation directs users to reveal it through a separate command.
The token is an authentication credential sent in the
TOKENHTTPS header towww.guaikei.com. Consequently, disclosure may allow another party to authenticate to that service as the affected token holder.Attack Path
- A user encounters an authentication or configuration error.
- The user follows the troubleshooting instruction in
SKILL.md. - The shell prints the complete
GUAIKEI_API_TOKEN. - The output is retained in a CI log, agent transcript, support bundle, screenshot, terminal recording, or screen-sharing session.
- An unauthorized party obtains the exposed value.
- The party reuses the token against the Guaikei API until it expires or is revoked.
This attack requires access to the terminal output or a retained copy of it; the instruction does not independently transmit the token to an additional host.
Impact Assessment
An attacker who obtains the token may consume the associated third-party API service and quota with the token holder’s authorization. Depending on server-side account controls not ...[truncated 398 chars]
- Remediation
View remediation
Remediation Suggestions
Replace the value-printing command with a presence-only check:
sh if [ -n "${GUAIKEI_API_TOKEN:-}" ]; then echo "GUAIKEI_API_TOKEN is configured" else echo "GUAIKEI_API_TOKEN is missing" fiAdditional hardening measures:
- Explicitly warn users never to print, paste, screenshot, or include the token in diagnostic logs.
- If token identification is necessary, use a purpose-built script that displays only a short masked prefix and suffix.
- Redact
GUAIKEI_API_TOKENfrom CI logs, agent transcripts, support bundles, and shell recordings. - Advise users to revoke and rotate any token previously exposed through terminal output.
- Preserve the existing implementation behavior in
scripts/utils/token.js, which reports token presence without printing the token value. - Add automated documentation scanning for commands that print secret-bearing environment variables.
