T09 · Insecure Skill Coding Practices
- Location
SKILL.md:271- Finding
API Token Disclosure Through Unsafe Troubleshooting Instruction
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:271
Vulnerability Type: Sensitive credential exposure through terminal output
Risk Level: MediumVulnerable code snippet:
sh echo $GUAIKEI_API_TOKENTechnical Analysis
The troubleshooting instructions recommend printing the complete value of the
GUAIKEI_API_TOKENenvironment variable. This token is a sensitive credential used to authenticate requests to the third-party API.Printing it exposes the secret to the terminal, captured standard output, agent conversation transcripts, command-execution logs, CI/CD logs, screen-sharing sessions, shell recording systems, and any monitoring service that collects process output. The instruction is unnecessary because token presence and basic format can be verified without revealing its value.
The application itself sends the token to the fixed, documented
www.guaikei.comservice over HTTPS, which is necessary for its declared API functionality. The confirmed issue is specifically the instruction to reveal the full token throughecho, not the authenticated HTTPS API request.Attack Path
- A user or agent encounters the documented startup or authentication failure.
- The user or agent follows the troubleshooting instruction and executes
echo $GUAIKEI_API_TOKEN. - The complete API token is written to terminal output.
- The output is retained in an agent transcript, execution log, CI log, terminal recording, or other observable channel.
- An attacker with access to that channel extracts the token.
- The attacker reuses the token against the Guaikei API until it expires or is revoked.
This path does not grant local operating-system privileges. It grants whatever API access, quota, data retrieval capabilities, and billing impact are associated with the compromised token.
Impact Assessment
Successful exploitation may result in:
- Unauthorized use of the victim's Guaikei API ...[truncated 590 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove the instruction to execute
echo $GUAIKEI_API_TOKEN. -
Replace it with a presence-only check that does not disclose the value:
sh if [ -n "${GUAIKEI_API_TOKEN:-}" ]; then printf '%s\n' "GUAIKEI_API_TOKEN is configured" else printf '%s\n' "GUAIKEI_API_TOKEN is not configured" fi -
If format diagnostics are required, perform validation inside the application and report only non-sensitive properties such as whether the token is present, whether its length is acceptable, and whether it contains permitted characters.
-
Never print the full token. If an identifier is operationally necessary, display only a heavily redacted representation, such as the final four characters, and ensure even that output is not written to persistent logs.
-
Add explicit documentation warning users not to paste tokens into chat messages, issue trackers, screenshots, support requests, or command output.
-
Redact authentication headers and environment-variable values in all application, agent, CI/CD, and observability logs.
-
Revoke and rotate any token that may already have been exposed by following the existing instruction.
-
