T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:177- Finding
Sensitive Environment Variable Enumeration May Expose Credentials
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 177–186
Vulnerability Type: Sensitive credential discovery through unnecessary environment enumeration
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 instructs an AI Agent with execution capability to enumerate environment variables whose names contain
API,KEY,TOKEN, orSECRET. This broad credential-discovery operation is not necessary for the skill's stated personal-productivity functions.The Unix command masks values using
sed, but it still reveals the names and existence of potentially sensitive credentials. More importantly, the suggested PowerShell command formats complete environment-variable objects and does not mask their values. If an Agent or user runs that command, API keys and access tokens may be copied into terminal output, Agent context, execution logs, conversation history, or telemetry.This violates least-privilege principles by directing the Agent to inspect unrelated credentials rather than checking one explicitly documented configuration variable without retrieving its value.
Attack Path
- A user installs or invokes the skill in an Agent environment that has
execaccess. - The Agent follows the environment-verification instructions in
SKILL.md. - It executes the Unix or PowerShell environment-enumeration command.
- The command discovers variables associated with API keys, tokens, and secrets.
- On PowerShell, the values may be printed in full; on Unix, credential names and presence are disclosed.
- The resulting output may be incorporated into Agent context, logs, chat history, or external platform telemetry.
- Any party with access to those records c ...[truncated 692 chars]
- A user installs or invokes the skill in an Agent environment that has
- Remediation
View remediation
Remediation Suggestions
- Remove all broad searches over the process environment.
- Document the exact environment variable required by the skill, if one is genuinely necessary.
- Verify only whether that specific variable exists, without printing or returning its value.
- For PowerShell, use a presence-only check such as:
powershell if (Test-Path Env:EXPECTED_API_KEY) { Write-Output "EXPECTED_API_KEY is configured" } else { Write-Output "EXPECTED_API_KEY is not configured" } - For POSIX shells, use a presence-only check such as:
bash if [ -n "${EXPECTED_API_KEY+x}" ]; then echo "EXPECTED_API_KEY is configured" else echo "EXPECTED_API_KEY is not configured" fi - Ensure command output, Agent logs, and diagnostic telemetry redact secret values by default.
- Remove the
execpermission if the productivity-advisory workflow does not require command execution.
