T09 · Insecure Skill Coding Practices
- Location
SKILL.md:177- Finding
Overbroad Enumeration of Credential-Related Environment Variables
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 177–184
Vulnerability Type: Credential-related environment reconnaissance
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 the Agent to enumerate the process's entire environment and select variables whose names contain credential-related terms such as
API,KEY,TOKEN, orSECRET. This is broader than necessary to validate Notion authentication and violates least-exposure principles.The Unix pipeline masks values before displaying them, but it still reads every environment variable and reveals the names of unrelated credentials and integrations. Such names can disclose which cloud providers, APIs, deployment systems, or authentication mechanisms are present.
The commented PowerShell alternative is less safe because
Format-Tablemay display both names and values of matching environment variables if a user or Agent executes it after removing the comment markers. The document already provides the narrowernotion-cli auth statuscommand, so generic environment enumeration is unnecessary.No credential-value theft or external transmission is established by the reviewed file. The issue is limited to excessive local discovery and possible disclosure through Agent-visible output, terminal history, or execution logs.
Attack Path
- A user asks an AI Agent to configure or verify the Skill.
- The Agent follows the environment-validation instructions in
SKILL.md. - The shell reads the entire process environment and filters credential-related entries.
- Matching variable names—and potentially values if the PowerShell alternative is used—appea ...[truncated 844 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove generic
envandGet-ChildItem Env:enumeration from the Skill. -
Use the already documented, purpose-specific authentication check:
bash notion-cli auth status -
If a specific environment variable must be checked, test only the documented Notion variable without printing its value:
bash if test -n "${NOTION_TOKEN:-}"; then echo "NOTION_TOKEN is configured" else echo "NOTION_TOKEN is not configured" fi -
For PowerShell, use a Boolean existence check rather than formatting the environment entry:
powershell if ([string]::IsNullOrEmpty($env:NOTION_TOKEN)) { Write-Output "NOTION_TOKEN is not configured" } else { Write-Output "NOTION_TOKEN is configured" } -
Prevent credential-related environment inventory from being included in Agent responses, execution logs, cached results, or diagnostic bundles.
-
Explicitly instruct the Agent never to print authentication tokens or unrelated environment-variable names during configuration validation.
-
