T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:185- Finding
Sensitive Environment Variable Enumeration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 185–187
Vulnerability Type: Sensitive environment-variable enumeration beyond legitimate task requirements
Risk Level: MediumVulnerable Code
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 asks the Agent to inspect all environment variables whose names contain
API,KEY,TOKEN, orSECRET. This is unrelated to the stated note-management functionality and violates least-privilege principles. Verifying the note-taker configuration only requires checking the documentedNOTE_TAKER_DIRvariable.The Unix command masks values after enumeration, but still exposes sensitive variable names and reveals which services or credential types are configured. The PowerShell alternative is more dangerous because
Get-ChildItem Env:returns both names and values; filtering and formatting do not redact those values. Consequently, API keys and authentication tokens may be printed directly.Because the instructions are intended to drive an AI Agent with execution capability, command output may also enter Agent context, terminal logs, transcripts, or other retained execution records.
Attack Path
- A user loads the skill and follows its configuration-verification instructions.
- The AI Agent invokes the documented command through its execution tool.
- The command enumerates unrelated credential-bearing environment variables.
- On Linux or macOS, credential names and configured services are disclosed, although values are masked.
- On PowerShell, matching environment-variable names and their complete values may be displayed.
- The sensitive output may be exposed to the user, retained in logs or conversation history, or become available to s ...[truncated 712 chars]
- Remediation
View remediation
Remediation Suggestions
Remove broad environment enumeration and verify only the specific setting required by the skill.
For Linux and macOS, use a targeted presence check that does not print the value:
bash if [ -n "${NOTE_TAKER_DIR:-}" ]; then echo "NOTE_TAKER_DIR is configured" else echo "NOTE_TAKER_DIR is not configured; the default directory will be used" fiFor PowerShell, use:
powershell if (Test-Path Env:NOTE_TAKER_DIR) { Write-Output "NOTE_TAKER_DIR is configured" } else { Write-Output "NOTE_TAKER_DIR is not configured; the default directory will be used" }Additional hardening measures:
- Do not enumerate variables matching broad credential-related terms.
- Never print credential values as part of configuration diagnostics.
- Limit execution instructions to resources strictly required for note management.
- Ensure Agent and terminal logs redact secrets as defense in depth.
- Document each environment variable the skill requires and validate only those explicitly named variables.
