T09 · Insecure Skill Coding Practices
- Location
SKILL.md:190- Finding
Plaintext Disclosure of Sensitive Environment Variables on Windows
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 190–196
Vulnerability Type: Sensitive information exposure through diagnostic output
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 PowerShell command enumerates environment variables whose names contain
API,KEY, orTOKENand sends the resulting objects toFormat-Table. Unlike the Linux/macOS command, it does not redact variable values.If an agent or user follows this Windows validation instruction, matching credentials can be displayed in plaintext. Terminal capture, agent execution transcripts, command logs, screen sharing, or CI logs may then retain those values. Enumerating all matching variables also exceeds what is necessary to confirm that a specific required credential exists.
This is an insecure diagnostic practice rather than evidence of deliberate exfiltration: the Skill does not instruct the agent to transmit the output to a remote party.
Attack Path
- A user loads the Skill in an agent environment on Windows.
- The user or agent follows the documented configuration-validation procedure.
- PowerShell enumerates all environment variables with names matching
API,KEY, orTOKEN. Format-Tabledisplays the associated values without masking them.- Sensitive values are captured in the terminal, agent transcript, CI output, or other command logs.
- Anyone with access to those records can recover and misuse the exposed credentials.
Impact Assessment
The immediate scope is disclosure of credentials stored in matching environment variables under the current process or user context. Depending on the permissions as ...[truncated 420 chars]
- Remediation
View remediation
Remediation Suggestions
-
Never print secret values while validating configuration.
-
Check only the exact environment-variable names required by the Skill rather than broadly enumerating names containing
API,KEY, orTOKEN. -
Return only presence or absence, for example:
powershell $required = @("REQUIRED_API_KEY") foreach ($name in $required) { $configured = [Environment]::GetEnvironmentVariable($name) -ne $null [PSCustomObject]@{ Name = $name Configured = $configured Value = if ($configured) { "***" } else { "" } } } -
If broad discovery is genuinely required, project only the variable name and a fixed redacted marker; do not pass raw environment-variable objects to formatting or logging commands.
-
Ensure agent and CI systems suppress command output that could contain secrets, limit transcript access, and apply log-retention controls.
-
Rotate any credential that may already have appeared in terminal output, agent transcripts, or CI logs.
-
