T09 · Insecure Skill Coding Practices
- Location
SKILL.md:134- Finding
API Key Disclosed Through Command Output
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:134-137
Vulnerability Type: Secret exposure through terminal, agent, or logging output
Risk Level: HighVulnerable Code
bash echo "$IFLOW_API_KEY"Technical Analysis
The Skill instructs the agent to verify whether
IFLOW_API_KEYis 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
- A user configures a valid iFlow API key in
IFLOW_API_KEY. - The agent follows the mandatory preflight instruction in
SKILL.md. - The command prints the complete key to standard output.
- The execution framework records that output in a transcript, trace, or log.
- A party with access to the recorded output extracts the key.
- 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.
- A user configures a valid iFlow API key in
- Remediation
View 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 fiAlternatively, use:
bash printenv IFLOW_API_KEY >/dev/nullNever 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.
