T09 · Insecure Skill Coding Practices
- Location
- SKILL.md:614
- Finding
- Maton API Key Disclosed in Troubleshooting Output<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:614-619` **Vulnerability Type**: Credential exposure through terminal output **Risk Level**: Medium ### Vulnerable Code ```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 procedure instructs users to print the complete `MATON_API_KEY` value to standard output. This credential authenticates requests to the Maton gateway and connection-management endpoints. Displaying the secret is unnecessary when only its presence needs to be verified. The value may be captured in terminal recordings, CI/CD logs, remote support sessions, screenshots, command output copied into tickets, or other diagnostic artifacts. Although the command does not deliberately transmit the credential to an unrelated server, it materially increases the likelihood of accidental disclosure. ### 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 API key appears in terminal output. 4. The output is captured by terminal logging, screen sharing, automation logs, screenshots, or copied diagnostic information. 5. An attacker obtains the exposed key. 6. The attacker submits the key as a bearer credential to `gateway.maton.ai` or `ctrl.maton.ai`. 7. Subject to the key's server-side permissions, the attacker accesses authorized third-party connections or performs supported connection-management operations. ### Impact Assessment A disclosed key may permit unauthorized calls through any third-party connection associated with the Maton account, within the OAuth scopes previously authorized by the user. This could expose connected-service data or permit modification and deletion operations supported by those scopes. The key also authenticates connection-management requests. Consequent ...[truncated 284 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Replace secret-printing instructions 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 ``` - If limited fingerprinting is necessary, show only a short non-sensitive identifier generated by the service rather than any portion of the bearer token. - Warn users not to include API keys in logs, screenshots, support tickets, shell tracing, or copied terminal output. - Ensure application and gateway logs redact `Authorization` headers and known key formats. - Provide a documented key-revocation and rotation procedure. - Advise immediate rotation whenever the key has been displayed in a recorded or shared environment. ]]>
