T09 · Insecure Skill Coding Practices
- Location
SKILL.md:133- Finding
Shared Environment File Exposes Unrelated Credentials to Child Processes
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:133
Vulnerability Type: Broad credential exposure through indiscriminate environment export
Risk Level: HighVulnerable Code Snippet:
markdown - **Auth:** credentials live in `~/code/.env`. Load with `set -a; source ~/code/.env; set +a` before invoking.Technical Analysis
The instruction uses
set -abefore sourcing the shared~/code/.envfile. This causes every variable assigned by that file to be exported into the environment, not merely theOPENAI_API_KEY,VOLC_ASR_APPID, andVOLC_ASR_ACCESS_TOKENvalues required by the declared transcription workflow.Every subsequently launched process inherits these exported values by default. The skill also recommends executing dynamically resolved Python dependencies through
uvx, substantially increasing the consequences of exposing the complete environment to child processes.This exceeds least privilege because the skill only needs credentials for the selected ASR provider. It does not require access to every secret stored in the user's shared environment file.
Attack Path
- The operator follows the skill instruction and runs
set -a. - The shared
~/code/.envfile is sourced. - All variables defined by the file, including credentials unrelated to transcription, are exported.
- The operator launches Python,
uvx,httpx, Whisper, or another child process as part of the workflow. - A compromised, malicious, or vulnerable dependency reads inherited secrets through the process environment.
- The dependency can transmit those secrets over the network or use them to access associated services.
Exploitation is conditional on untrusted code executing after the environment is exported, but the skill's unpinned runtime dependency instructions provide a credible route for that condition to occur.
Impact Assessment
An executing child process could obtain all credentials ex ...[truncated 450 chars]
- The operator follows the skill instruction and runs
- Remediation
View remediation
Remediation Suggestions
- Do not use
set -awith a shared environment file. - Store transcription credentials in a dedicated file containing only the required ASR variables and restrict its permissions, for example to owner read/write access.
- Pass only the credential required for the selected provider to the relevant process.
- Run OpenAI and Volcano operations in separate, narrowly scoped environments.
- Clear temporary environment variables immediately after the API operation.
- Ensure subprocesses that do not require credentials receive a sanitized environment.
- Prefer a platform secret manager or credential helper that can provide a single secret to a specific process without exposing unrelated values.
- Document the exact required variables:
OPENAI_API_KEYfor OpenAI, orVOLC_ASR_APPIDandVOLC_ASR_ACCESS_TOKENfor Volcano.
- Do not use
