T09 · Insecure Skill Coding Practices
- Location
SKILL.md:27- Finding
Insecure API Key Collection Through Conversational Input
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 27–32
Vulnerability Type: Sensitive credential exposure through insecure collection and storage guidance
Risk Level: MediumVulnerable Code
markdown If the user hasn't provided a key yet, tell them: > "To fetch YouTube transcripts I need a TranscriptAPI.com API key. It's free — sign up at transcriptapi.com, copy your API key from the dashboard, and paste it here." Store the key as `TRANSCRIPT_API_KEY` wherever your agent manages credentials.Technical Analysis
The Skill explicitly directs users to paste a TranscriptAPI bearer credential into the conversation. Conversational input may be retained in chat history, agent traces, telemetry, debugging logs, persistent memory, or downstream integrations. The subsequent instruction to store the key “wherever” credentials are managed does not mandate a protected secret store, prohibit plaintext persistence, or require redaction from logs and model output.
The manifest correctly declares
TRANSCRIPT_API_KEYas a required environment variable, so collecting it through chat exceeds the minimum privilege and exposure necessary. The credential should instead be provisioned directly through the hosting platform’s secret manager or environment configuration.The transcript request itself sends the bearer credential only to the declared service:
bash curl -s "https://transcriptapi.com/api/v2/youtube/transcript?video_url=VIDEO_ID&format=json&include_timestamp=true&send_metadata=true" \ -H "Authorization: Bearer YOUR_API_KEY"No transmission of the key to an unrelated endpoint was identified. The vulnerability is the insecure collection and potentially ambiguous storage process, rather than confirmed malicious exfiltration.
Attack Path
- A user follows the Skill’s setup instruction and pastes their TranscriptAPI key into the conversation.
- The plaintext credential becomes part of the agent’s conversational context and ...[truncated 1025 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the instruction asking users to paste API keys into conversational input.
- Direct users to configure
TRANSCRIPT_API_KEYthrough the agent platform’s protected secret manager or process environment. - Fail safely when the variable is absent, providing setup instructions that never request disclosure of the secret’s value.
- Explicitly prohibit logging, echoing, displaying, persisting in ordinary files, or including the credential in generated output.
- Ensure command execution injects the credential directly from the protected environment rather than interpolating it into visible command histories or diagnostics.
- Redact
Authorizationheaders and values matching credential patterns from telemetry, traces, errors, and debugging output. - Scope the API key to the minimum service permissions available, apply quota limits where supported, and provide key rotation and revocation guidance.
- Replace the affected guidance with wording such as:
markdown Configure `TRANSCRIPT_API_KEY` using your agent platform's secret manager. Do not paste the key into chat. The Skill must read it only from the protected environment and must never log, display, or persist its value.
