T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:34
- Finding
- Provider API Keys May Be Exposed Through Environment Enumeration## Vulnerability Details **File Location**: `SKILL.md`, lines 34-36 **Vulnerability Type**: Sensitive credential exposure through insecure diagnostic instructions **Risk Level**: Medium ### Vulnerable Code ```bash # Check environment for API keys env | grep -i "OPENAI\|ANTHROPIC\|DEEPSEEK" ``` ### Technical Analysis The diagnostic command enumerates environment variables whose names contain provider identifiers and prints both their names and complete values. Variables such as `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or similarly named credentials may therefore be disclosed in plaintext. Checking whether credentials are configured does not require exposing their values. If an agent follows these instructions, the resulting secrets may enter terminal history, command output, execution logs, session transcripts, or model context. The project contains no evidence of intentional exfiltration, but this unsafe diagnostic practice creates an avoidable credential-disclosure channel. ### Attack Path 1. A rate-limit or quota error causes an operator or agent to use this recovery skill. 2. The agent executes the documented environment-enumeration command. 3. The command prints matching variables, including complete API-key values. 4. The output is captured in an agent session, terminal log, CI log, monitoring system, or transcript. 5. A user or process able to access that retained output obtains the exposed credentials. 6. The credentials may be used against the corresponding provider, subject to their assigned permissions, quotas, and account controls. ### Impact Assessment Successful exploitation could disclose API credentials available to the process running the diagnostic command. An attacker could consume provider quotas, incur charges, access provider resources permitted by the exposed key, or disrupt workloads by exhausting limits or revoking the credential. The scope is limited to matching environment variables visible to the executing process and to the ...[truncated 167 chars]
- Remediation
- ## Remediation Suggestions - Do not print complete environment-variable values during diagnosis. - Check only whether each expected variable is set, for example: ```bash for name in OPENAI_API_KEY ANTHROPIC_API_KEY DEEPSEEK_API_KEY; do if [ -n "${!name:-}" ]; then printf '%s=%s\n' "$name" "[SET]" else printf '%s=%s\n' "$name" "[NOT SET]" fi done ``` - If partial identification is operationally necessary, reveal only a short non-sensitive fingerprint and never the complete secret. - Prevent credential-bearing output from being written to agent context, CI logs, shell tracing, monitoring systems, or persistent transcripts. - Apply log redaction for recognized provider-key formats as defense in depth. - Rotate any key that may already have appeared in retained command output or logs. - Run recovery diagnostics with a least-privileged environment containing only the credentials required for the task.
