T09 · Insecure Skill Coding Practices
- Location
SKILL.md:526- Finding
API Key Exposed in Plaintext by Troubleshooting Command
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 526-531
Vulnerability Type: Plaintext sensitive credential exposure
Risk Level: MediumVulnerable code snippet:
markdown 1. Check that the `MATON_API_KEY` environment variable is set: ```bash echo $MATON_API_KEYtext ### Technical Analysis The troubleshooting instructions print the complete `MATON_API_KEY` bearer credential to standard output. Although the key is not hardcoded in the project, revealing its value is unnecessary when merely checking whether the environment variable is configured. Terminal output may be retained in CI logs, agent tool transcripts, shell-session recordings, support records, screenshots, or screen-sharing sessions. Because the Skill uses this value as a bearer token in `Authorization` headers, possession of the exposed key may be sufficient to authenticate to Maton services. The documented transmission of the key to `gateway.maton.ai` and `ctrl.maton.ai` is part of the declared managed-OAuth design. The vulnerability is the separate instruction to disclose the raw key in terminal output. ### Attack Path 1. A user encounters an authentication problem and follows the documented troubleshooting procedure. 2. The user runs `echo $MATON_API_KEY`. 3. The complete bearer credential appears in terminal output. 4. That output is captured in an agent transcript, CI log, support message, screenshot, terminal recording, or screen-sharing session. 5. An unauthorized party retrieves the exposed value. 6. The party submits it as a bearer credential to `gateway.maton.ai` or `ctrl.maton.ai`. 7. If the key remains valid, the party may perform operations allowed by the associated account and connected Google Drive authorization. ### Impact Assessment Successful exploitation may expose the privileges associated with the Maton account and its active Google Drive connection. Depending on the OAuth permissions and accou ...[truncated 460 chars]- Remediation
View remediation
Remediation Suggestions
Replace the raw-value command with a presence-only check that never prints the secret:
bash if [ -n "${MATON_API_KEY:-}" ]; then echo "MATON_API_KEY is set" else echo "MATON_API_KEY is not set" fiAdditional hardening measures:
- Explicitly warn users never to print, log, paste, or screenshot API keys.
- Recommend redacting authorization headers and secrets from diagnostic output.
- Ensure CI and agent environments mask
MATON_API_KEY. - Avoid shell tracing such as
set -xwhile handling credentials. - Recommend immediate rotation through Maton account settings if a key has appeared in logs, transcripts, screenshots, or support messages.
- Prefer short-lived, narrowly scoped credentials where supported.
- Document the data-security implications of routing Drive content through the Maton gateway so users can make an informed authorization decision.
