T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:186- Finding
Credential Exposure Through Broad Environment Variable Enumeration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 186–190
Vulnerability Type: Credential-related 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 Skill instructs an AI Agent to enumerate environment variables whose names contain credential-related terms such as
API,KEY,TOKEN, orSECRET. This operation is not required for the stated PPTX creation, editing, or validation functionality and exceeds the task's legitimate access needs.The Unix command masks values after retrieving them, but still inventories secret-bearing variable names and relies on a text-processing pipeline to prevent disclosure. The proposed PowerShell equivalent is more severe:
Format-Tabledisplays both environment-variable names and their values without redaction. If an Agent executes that command, API keys, access tokens, or other secrets can become visible in the terminal transcript, Agent context, execution logs, or monitoring systems.The project contains no instruction to transmit these values to a remote endpoint, so external exfiltration is not established. The issue is nevertheless a local unauthorized-access and disclosure risk because the Skill encourages access to credentials unrelated to presentation processing.
Attack Path
- A user loads the Skill in an AI Agent that has command-execution capability.
- The Agent follows the environment validation procedure in
SKILL.md. - On Windows, the Agent executes the suggested PowerShell pipeline.
- PowerShell selects environment variables with names containing
API,KEY, orTOKEN. Format-Tableprints the selected variables, including their unredacted values.- Credential values are retained in terminal o ...[truncated 663 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove broad enumeration of environment variables based on generic credential-related patterns.
- Validate only the exact environment-variable names that are documented and strictly required by the Skill.
- Return only a boolean or status message indicating whether each required variable exists; never print its value.
- Apply equivalent redaction behavior across all supported operating systems.
- Avoid placing credential values in Agent context, terminal output, diagnostic logs, callback payloads, or error messages.
- If no external API is necessary for a PPTX operation, do not inspect API credentials at all.
A safer PowerShell presence check is:
powershell if ($env:REQUIRED_API_KEY) { "REQUIRED_API_KEY is configured" } else { "REQUIRED_API_KEY is missing" }A safer POSIX-compatible presence check is:
bash if [ -n "${REQUIRED_API_KEY:-}" ]; then echo "REQUIRED_API_KEY is configured" else echo "REQUIRED_API_KEY is missing" fi
