T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:596
- Finding
- Full API Credential Exposed by Troubleshooting Command## Vulnerability Details **File Location**: `SKILL.md`, lines 596–600 **Vulnerability Type**: Secret disclosure through insecure diagnostic guidance **Risk Level**: Medium **Vulnerable code snippet**: ```markdown 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 is unnecessary when the intended diagnostic goal is only to determine whether the variable is configured. Terminal output may be retained in shell transcripts, AI-agent execution logs, CI/CD logs, screen recordings, shared support sessions, or copied diagnostic reports. Although the key does not independently authorize new third-party OAuth connections, the Skill documentation states that it authenticates requests to `gateway.maton.ai` and `ctrl.maton.ai`. Therefore, disclosure can provide access to third-party services already connected to the affected Maton account. ### Attack Path 1. A user encounters an authentication error and follows the documented troubleshooting procedure. 2. The user or Agent executes `echo $MATON_API_KEY`. 3. The complete bearer credential appears in terminal output. 4. The output is retained in an Agent transcript, CI log, shared console, screen capture, or support report. 5. An attacker with access to that output extracts the credential. 6. The attacker submits it in the `Authorization: Bearer` header to Maton gateway or connection-management endpoints. 7. Subject to server-side controls and the OAuth scopes of existing connections, the attacker can read, create, modify, or delete third-party resources and inspect or manage connection records. ### Impact Assessment Successful exploitation compromises the Maton account capability represented by the exposed key. The attainable scope depends on existing authorized connections and their OAuth or API-key per ...[truncated 585 chars]
- Remediation
- ## Remediation Suggestions Replace the secret-printing command with a presence-only check that never reveals 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 warn users never to print, paste, log, or share the API key. 2. Redact authorization headers and environment-variable values from Agent, application, proxy, and CI logs. 3. Provide a dedicated server-side credential-validation endpoint that returns only validity status and no sensitive account data. 4. Support prompt key revocation and rotation from the Maton account interface. 5. Apply least-privilege scopes to every third-party connection and require confirmation for destructive operations. 6. Monitor for anomalous key use, including unfamiliar IP addresses, unusual providers, destructive calls, and rapid connection enumeration. 7. Avoid placing connection session tokens in logs or copied troubleshooting output.
