T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:134
- Finding
- API Key Disclosed Through Command Output## Vulnerability Details **File Location**: `SKILL.md:134-137` **Vulnerability Type**: Secret exposure through terminal, agent, or logging output **Risk Level**: High ### Vulnerable Code ```bash echo "$IFLOW_API_KEY" ``` ### Technical Analysis The Skill instructs the agent to verify whether `IFLOW_API_KEY` is configured by printing its complete value. Agent command output may be retained in conversation transcripts, execution traces, monitoring platforms, terminal history, or diagnostic logs. Revealing the secret is unnecessary for checking whether the variable exists. The check should inspect only whether the variable is non-empty and should produce no secret-bearing output. ### Attack Path 1. A user configures a valid iFlow API key in `IFLOW_API_KEY`. 2. The agent follows the mandatory preflight instruction in `SKILL.md`. 3. The command prints the complete key to standard output. 4. The execution framework records that output in a transcript, trace, or log. 5. A party with access to the recorded output extracts the key. 6. The exposed key is reused against the iFlow API. ### Impact Assessment An attacker could exercise the permissions associated with the exposed iFlow credential, consume its API quota, issue requests attributed to the victim, and potentially access account-scoped API capabilities. This does not directly grant local host privileges, but its scope includes the remote API authority assigned to the key.
- Remediation
- ## Remediation Suggestions Replace the value-printing check with a silent existence test: ```bash if [[ -z "${IFLOW_API_KEY:-}" ]]; then printf '%s\n' "IFLOW_API_KEY is not configured." >&2 exit 1 fi ``` Alternatively, use: ```bash printenv IFLOW_API_KEY >/dev/null ``` Never include the credential value in logs, diagnostics, error messages, or agent-visible command output. Existing keys that may have been printed should be rotated, and retained execution logs should be reviewed for exposure.
