T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:303
- Finding
- API Credential Disclosure Through Troubleshooting Command## Vulnerability Details **File Location**: `SKILL.md`, lines 303–309 **Vulnerability Type**: Exposure of a bearer API credential in terminal output **Risk Level**: Medium **Vulnerable code snippet**: ```markdown ### Troubleshooting: API Key Issues 1. Check that the `MATON_API_KEY` environment variable is set: ```bash echo $MATON_API_KEY ``` ``` ### Technical Analysis The troubleshooting instructions tell users or an executing Agent to print the complete `MATON_API_KEY` value to standard output. This bearer credential is used to authenticate requests to Maton services, including the Gmail gateway and connection-management API. Printing the raw credential violates secret-handling best practices. Terminal output can be retained in shell scrollback, Agent conversation transcripts, CI/CD logs, debugging captures, screen recordings, or support bundles. An attacker who can read any such output may recover the credential without compromising its original storage. The project does not contain evidence that the command independently transmits the key to an attacker. Exploitation requires another party to obtain the resulting terminal or execution output. ### Attack Path 1. A user experiences an authentication problem and follows the documented troubleshooting procedure. 2. The user or Agent runs `echo $MATON_API_KEY`. 3. The complete bearer credential appears in terminal output. 4. The output is retained in a transcript, log, screenshot, recording, or support artifact. 5. An unauthorized party obtains access to that artifact and extracts the credential. 6. The party presents the credential to Maton APIs. 7. Subject to the credential's server-side permissions and active Gmail connections, the party accesses or manipulates connected Gmail resources. ### Impact Assessment Successful exploitation may permit impersonation of the Maton account associated with the exposed key. Based on the documented Skill functional ...[truncated 615 chars]
- Remediation
- ## Remediation Suggestions 1. Replace the secret-printing command with a presence-only check: ```bash if [ -n "${MATON_API_KEY:-}" ]; then echo "MATON_API_KEY is set" else echo "MATON_API_KEY is not set" fi ``` 2. If limited diagnostics are necessary, display only a non-sensitive fingerprint derived from the key rather than any portion of the key itself. 3. Explicitly warn users not to include API keys, authorization headers, OAuth session URLs, or raw command output containing credentials in support requests, logs, or screenshots. 4. Recommend immediate API-key revocation and rotation whenever terminal output containing the credential may have been retained or shared. 5. Ensure Agent and CI environments redact `MATON_API_KEY` and `Authorization` header values from command output, traces, exception messages, and execution transcripts. 6. Apply least privilege and short credential lifetimes on the server side where supported, and monitor the key for anomalous access following suspected disclosure.
