T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:37
- Finding
- Hardcoded Shared API Credential Used as an Automatic Fallback<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:37-38` - `SKILL.md:204-206` - `mx_data.md:36-37` - `mx_search.md:25-26` - `mx_select_stock.md:27-28` - `mx_data.json:14` - `mx_search.json:14` - `mx_select_stock.json:24` **Vulnerability Type**: Hardcoded API credential **Risk Level**: Medium **Classification**: T09: Insecure Skill Coding Practices ### Vulnerable Code The following is an English rendering of the vulnerable instructions at `SKILL.md:37-38`; the credential is reproduced exactly: ```text 1. First check whether the MX_APIKEY environment variable exists. 2. If it does not exist, use the following default example API key: mkt_ViJH0AwP4CIQDQxVAYK0DNAK4vlYujJvjapAQx7T4tU ``` The same fallback credential is embedded in the individual Skill definitions. For example, `mx_search.json:14` contains the equivalent instruction: ```text If MX_APIKEY is absent, use the default example API key: mkt_ViJH0AwP4CIQDQxVAYK0DNAK4vlYujJvjapAQx7T4tU ``` The documented request pattern is: ```bash curl -X POST --location 'https://mkapi2.dfcfs.com/finskillshub/api/claw/news-search' \ --header 'Content-Type: application/json' \ --header 'apikey: mkt_ViJH0AwP4CIQDQxVAYK0DNAK4vlYujJvjapAQx7T4tU' \ --data '{"query":"financial query"}' ``` Equivalent instructions expose the same credential for these endpoints: ```text https://mkapi2.dfcfs.com/finskillshub/api/claw/news-search https://mkapi2.dfcfs.com/finskillshub/api/claw/stock-screen https://mkapi2.dfcfs.com/finskillshub/api/claw/query ``` ### Technical Analysis The project embeds an API key directly in all primary documentation and Skill configuration variants. More importantly, the instructions direct an Agent to use that key automatically whenever `MX_APIKEY` is unavailable. The value therefore functions as an operational fallback credential rather than merely as a placeholder such as `YOUR_API_KEY`. Any party able to read the Skill package can recover the credential without authenticat ...[truncated 2412 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Revoke or rotate the exposed credential immediately** - Treat the current key as disclosed. - Review its request history for unexpected callers, excessive use, or anomalous query patterns. - Confirm that the replacement key does not retain unnecessary API permissions. 2. **Remove the credential from every project file** - Remove it from `SKILL.md`, all three Markdown Skill files, and all three JSON Skill definitions. - Search repository history, release archives, generated packages, examples, logs, and documentation mirrors for additional copies. - Rewriting only the current files is insufficient if the credential remains recoverable from published history. 3. **Require explicit credential configuration** - Read the API key exclusively from `MX_APIKEY` or an approved secret manager. - If no credential is configured, stop safely and return a clear configuration error. - Do not silently fall back to a shared or vendor-owned key. 4. **Use non-secret placeholders in examples** - Replace real credential values with an unmistakable placeholder such as `YOUR_MX_API_KEY`. - Ensure copied examples cannot make authenticated requests until the user deliberately supplies a credential. 5. **Issue scoped, individual credentials** - Give each user or deployment a separate key. - Restrict each key to the required endpoints and read-only operations. - Apply per-key quotas, expiration, rotation, revocation, and audit logging. 6. **Add preventive repository controls** - Enable automated secret scanning in local hooks and continuous integration. - Block commits containing API-key patterns. - Maintain an incident procedure for credential rotation and review when a secret is detected. ]]>
