T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:151- Finding
Overbroad Enumeration of Credential-Related Environment Variables
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 151–153
Vulnerability Type: Credential exposure through unnecessary environment-variable enumeration
Risk Level: Mediumbash # 验证环境变量是否设置 echo "配置检查:" env | grep -E "API|KEY|TOKEN|SECRET" | sed "s/=.*/=***/" # Linux/macOS # 或 PowerShell # Get-ChildItem Env: | Where-Object {$_.Name -match "API|KEY|TOKEN"} | Format-TableTechnical Analysis
The setup-validation instructions enumerate every environment variable whose name contains credential-related terms such as
API,KEY,TOKEN, orSECRET. This is unnecessary for the Skill's stated SEO writing purpose and violates least-privilege principles.The Unix pipeline masks values before displaying them, but it still discloses the names of potentially sensitive variables. The PowerShell alternative does not apply equivalent redaction: environment-variable objects formatted as a table may display both variable names and their values. Consequently, API keys or tokens could be exposed in terminal output, Agent context, command transcripts, or retained logs.
There is no evidence that the Skill transmits this output to an external destination. Therefore, this finding establishes unnecessary credential access and potential local disclosure, but not confirmed network exfiltration.
Attack Path
- A user or Agent follows the documented configuration-validation procedure.
- The shell enumerates all environment variables matching broad credential-related patterns.
- On Unix-like systems, sensitive variable names are displayed even though their values are masked.
- Under the documented PowerShell alternative, matching variable values may also be displayed because no redaction is applied.
- The resulting output may enter the Agent's context, terminal history, execution logs, screenshots, or other records accessible to additional parties.
Impact Assessment
The instruction can reveal the existence and naming of credentials acros ...[truncated 532 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove broad enumeration based on generic patterns such as
API,KEY,TOKEN, andSECRET. - Validate only the exact environment variable required for the explicitly selected provider.
- Return only a presence/absence result and never print the variable's name or value. For example, use a provider-specific boolean check that emits only
configuredornot configured. - Apply equivalent non-disclosure behavior on every supported operating system; do not use
Format-Tableon environment-variable objects containing secret values. - Prevent command output containing credentials from entering Agent prompts, logs, telemetry, shell history, or error reports.
- Remove the declared
execcapability if it is not essential to text generation. If execution remains necessary, restrict it to a narrow allowlist of fixed commands without user-controlled interpolation. - Document the exact credential required by each optional integration rather than scanning the entire process environment.
- Remove broad enumeration based on generic patterns such as
