T09 · Insecure Skill Coding Practices
- Location
SKILL.md:402- Finding
Live API Key Exposed Through Terminal and Log Output
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 402-405
Vulnerability Type: Credential exposure through insecure logging
Risk Level: MediumVulnerable Code
bash export SKY_API_KEY=$(echo $RESPONSE | jq -r '.api_key') export SKY_EMAIL=$(echo $RESPONSE | jq -r '.email') echo "API Key: $SKY_API_KEY" echo "Email: $SKY_EMAIL"Technical Analysis
The documented setup script extracts a live bearer API key from the signup response and then prints it to standard output. Although storing the key in an environment variable is consistent with earlier guidance, explicitly displaying it creates additional copies of the credential in terminal scrollback, CI/CD logs, shell-session recordings, remote execution logs, and monitoring platforms.
The API key authenticates requests to Sky messaging endpoints. Consequently, it must be treated as a secret and should not be included in routine output. The exposure is particularly significant because the documentation states that signup keys use the production-oriented
sky_live_prefix.Attack Path
- A user copies and executes the documented setup script.
- The signup endpoint returns a live API key.
- The script writes that key to standard output.
- A terminal recorder, CI system, centralized logging service, shared console, or unauthorized observer captures the output.
- An attacker extracts the bearer key from the captured output.
- The attacker supplies it in an
Authorization: Bearerheader to impersonate the affected agent and access API operations permitted to that key.
Impact Assessment
Successful exploitation grants access within the scope of the compromised agent API key. Based on the documented API, an attacker may be able to send messages under the agent's identity and retrieve messages accessible to that account. This can result in agent impersonation, disclosure of email contents, abuse of the sending quota, and reputational harm.
The issue does not directly gra ...[truncated 144 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the statement that prints
SKY_API_KEY. - Write the key directly to an approved secret manager or permission-restricted configuration without passing it through logs.
- Disable shell tracing with
set +xaround secret-handling operations where applicable. - Configure CI/CD systems to mask values matching the API-key format, while treating masking only as defense in depth.
- Restrict access to build logs, terminal recordings, and execution output.
- Avoid placing the key in command-line arguments, which may be visible through process inspection.
- Provide a redacted confirmation message, such as
API key stored successfully, instead of displaying the secret. - Rotate any API key that has already appeared in logs and remove retained copies where feasible.
- Remove the statement that prints
