T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:594
- Finding
- API Key Disclosure Through Troubleshooting Command## Vulnerability Details **File Location**: `SKILL.md:594-600` **Vulnerability Type**: Sensitive credential exposure **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 instructions print the complete `MATON_API_KEY` value to standard output. This bearer credential authenticates requests to Maton's API gateway and connection-management service. Although transmitting the key in an HTTPS `Authorization` header is necessary for the declared gateway functionality, displaying it in plaintext is unnecessary. Terminal output can be captured in CI logs, agent transcripts, shell recordings, screenshots, support bundles, or shared troubleshooting output. ### Attack Path 1. A user encounters an authentication problem and follows the documented troubleshooting procedure. 2. `echo $MATON_API_KEY` prints the complete credential. 3. The terminal output is recorded, uploaded, copied into a support request, exposed in an agent transcript, or observed by another local user. 4. An attacker extracts the credential. 5. The attacker supplies it as a bearer token to `gateway.maton.ai` or `ctrl.maton.ai`. 6. The attacker accesses or modifies resources through the victim's existing authorized connections, subject to the OAuth scopes and permissions granted to those connections. ### Impact Assessment Credential compromise could allow an attacker to enumerate or manage Maton connections and invoke supported third-party APIs through authorized integrations. The exact scope depends on the victim's connected services and OAuth grants. Potential effects include reading sensitive business data, creating or modifying records, sending messages, and deleting resources where the underlying connection permits those operations. This issue does not independently expose third-party OAuth tokens, but the Maton ...[truncated 86 chars]
- Remediation
- ## Remediation Suggestions Replace the secret-printing command with a presence check that does not disclose the value: ```bash if [ -n "${MATON_API_KEY:-}" ]; then echo "MATON_API_KEY is set" else echo "MATON_API_KEY is not set" fi ``` Additional hardening measures: 1. Explicitly instruct users never to print, log, screenshot, or share the API key. 2. Redact authorization headers and secret environment variables from logs and support bundles. 3. Recommend immediate key rotation following suspected disclosure. 4. Prefer short-lived, narrowly scoped credentials where supported. 5. Document how users can review active connections and revoke unauthorized access. 6. Avoid placing session-bearing connection URLs in logs because their query parameters may also be sensitive.
