T09 · Insecure Skill Coding Practices
- Location
SKILL.md:176- Finding
Sensitive Environment Variable Disclosure During Configuration Validation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 176–181
Vulnerability Type: Sensitive credential exposure through broad environment-variable enumeration
Risk Level: MediumComplete 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 recommends enumerating every environment variable whose name contains
API,KEY,TOKEN, orSECRET. This is broader than necessary for its productivity-management functions.On Linux and macOS,
sedmasks values after the first equals sign, but sensitive variable names remain exposed. On PowerShell, the suggested pipeline formats complete environment-variable objects and does not redact their values. Consequently, API keys, access tokens, and similar credentials can be printed to the terminal and captured by the AI Agent's context, execution logs, retained transcripts, shell logging, screenshots, or monitoring systems.The project contains no direct exfiltration instruction. Exploitation therefore depends on an untrusted party gaining access to one of these output-retention channels.
Attack Path
- A user or AI Agent follows the configuration-validation instructions.
- On Windows, the PowerShell command selects all environment variables with names matching
API,KEY, orTOKEN. Format-Tabledisplays the matching variables without value redaction.- The terminal output is captured in an Agent transcript, execution log, screenshot, or monitoring record.
- A party with access to that retained output extracts the disclosed credentials.
- The party reuses the credentials against the services and permissions associated with them.
On Linux or macOS, the same process primarily discl ...[truncated 834 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove broad enumeration of environment variables based on generic secret-related names.
-
Validate only each explicitly required variable. This Skill currently identifies no concrete API variable that requires validation.
-
Use presence-only checks that never print credential values. For example:
bash if [ -n "${REQUIRED_API_KEY:-}" ]; then echo "REQUIRED_API_KEY is configured" else echo "REQUIRED_API_KEY is not configured" fipowershell if (Test-Path Env:REQUIRED_API_KEY) { Write-Output "REQUIRED_API_KEY is configured" } else { Write-Output "REQUIRED_API_KEY is not configured" } -
Apply equivalent non-disclosure behavior across all supported operating systems.
-
Avoid placing secret-bearing command output in AI Agent prompts, transcripts, diagnostic bundles, or persistent logs.
-
Document the minimum required variables and permissions. Recommend scoped, short-lived credentials where authentication is genuinely necessary.
-
If the original PowerShell command has already been used, review retained transcripts and logs, restrict access to them, securely delete unnecessary copies, and rotate any credentials that may have been exposed.
-
