T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:188- Finding
Sensitive Environment Credential Enumeration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 188–193
Vulnerability Type: Excessive access to sensitive environment variables
Risk Level: MediumVulnerable Code Snippet:
bash # Verify whether environment variables are configured echo "Configuration check:" env | grep -E "API|KEY|TOKEN|SECRET" | sed "s/=.*/=***/" # Linux/macOS # Or PowerShell # Get-ChildItem Env: | Where-Object {$_.Name -match "API|KEY|TOKEN"} | Format-TableTechnical Analysis
The Skill directs the Agent to enumerate environment variables associated with API keys, tokens, and secrets, even though credential discovery is not necessary for its stated report-aggregation functionality.
The Linux/macOS command redacts values after retrieving them but still discloses the names and existence of sensitive variables. More seriously, the PowerShell command passes complete environment-variable objects to
Format-Tablewithout selecting safe properties or redacting values. Its output can therefore contain both variable names and plaintext credential values.Because the Skill requests
execaccess, an Agent following these instructions may place credentials in terminal output, execution logs, conversation context, or retained transcripts. This violates least-privilege principles by accessing sensitive process data unrelated to the report-building task.Attack Path
- A user installs or invokes the Skill and follows its environment-validation procedure.
- The Agent executes the documented command using its
execcapability. - On Windows, PowerShell enumerates all environment variables whose names contain
API,KEY, orTOKEN. Format-Tabledisplays the matching objects without explicit value redaction.- Sensitive values are exposed in the terminal and may also be captured in Agent context, execution logs, transcripts, or downstream monitoring systems.
- Any party or subsequent instruction with acces ...[truncated 988 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove broad environment-variable enumeration because it is unrelated to local report aggregation.
- If a credential is genuinely required, check only the exact expected variable and return a boolean status rather than its value.
- Explicitly select safe output fields; never pass complete environment-variable objects to formatting or logging commands.
- Prevent command output containing secrets from entering Agent responses, execution logs, caches, or telemetry.
- Document each required credential, its purpose, and the minimum permissions it needs.
- Add automated checks that reject commands which enumerate variables using broad patterns such as
KEY,TOKEN, orSECRET.
A safer PowerShell presence check would be:
powershell if (Test-Path Env:REQUIRED_API_KEY) { "REQUIRED_API_KEY is configured" } else { "REQUIRED_API_KEY is not configured" }A safer POSIX presence check would be:
bash if [ -n "${REQUIRED_API_KEY+x}" ]; then echo "REQUIRED_API_KEY is configured" else echo "REQUIRED_API_KEY is not configured" fiSince the audited Skill does not identify a credential required for its core report-building behavior, the preferred remediation is to delete the environment credential-validation step entirely.
