T09 · Insecure Skill Coding Practices
- Location
SKILL.md:110- Finding
API Key Disclosure Through Diagnostic Command
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 110
Vulnerability Type: Secret exposure through insecure diagnostic guidance
Risk Level: MediumVulnerable Code Snippet:
markdown - Check API key is set: `echo $TAVILY_API_KEY`Technical Analysis
The documented diagnostic command prints the complete Tavily API key to standard output. Although the command does not transmit the key to an undeclared endpoint, revealing a credential in terminal output violates secure secret-handling practices.
Terminal output may be retained in CI logs, agent execution transcripts, shell session recordings, support tickets, screen captures, or shared terminal sessions. Confirming whether an environment variable is configured does not require displaying its value.
Attack Path
- A user or automated agent follows the documented troubleshooting instruction.
echo $TAVILY_API_KEYwrites the complete bearer credential to standard output.- The output is retained in a log, transcript, recording, or another observable channel.
- A party with access to that output obtains the API key.
- The exposed key is reused to authenticate requests to the Tavily API until it is rotated or revoked.
Impact Assessment
An attacker could obtain the privileges assigned to the exposed Tavily API key. The likely scope includes making Tavily API requests, consuming the account's search quota, triggering usage charges, and exhausting rate limits. The finding does not provide local system privileges, arbitrary code execution, or access beyond the permissions granted to the Tavily credential.
- Remediation
View remediation
Remediation Suggestions
Replace the secret-printing command with a presence check that never reveals the credential:
bash if [ -n "${TAVILY_API_KEY:-}" ]; then echo "TAVILY_API_KEY is set" else echo "TAVILY_API_KEY is not set" fiAlternatively, use:
bash test -n "${TAVILY_API_KEY:-}" && echo "TAVILY_API_KEY is set" || echo "TAVILY_API_KEY is not set"Additional hardening measures:
- Explicitly warn users not to print, log, paste, or commit API keys.
- Redact credentials from CI logs and agent transcripts.
- Rotate the Tavily API key if it has already appeared in recorded output.
- Restrict the key's quota and permissions where supported.
- Keep the key in a dedicated secret manager or protected environment variable.
