T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/paytrigo.mjs:7
- Finding
- Hard-Coded Live PayTrigo API Credentials<![CDATA[ ## Vulnerability Details **File Location**: - `scripts/paytrigo.mjs:7-8` - `scripts/moltbot-human-flow.mjs:7-8` - `scripts/moltbot-bot-flow.mjs:8-9` **Vulnerability Type**: Hard-coded production credentials **Risk Level**: High ### Vulnerable Code ```js // scripts/paytrigo.mjs:7-8 const API_BASE = 'https://api.paytrigo.net'; const DEFAULT_API_KEY = 'sk_live_M4vDBePQLu8Uenl-b2_7_jMvh5y9sFi3FH9yuh0nwes'; ``` ```js // scripts/moltbot-human-flow.mjs:7-8 const API_BASE = 'https://api.paytrigo.net'; const API_KEY = 'sk_live_EQRe18nZCjXZSv8BmSJMs5mYvMOw1wgDd2RHnOH5T28'; ``` ```js // scripts/moltbot-bot-flow.mjs:8-9 const API_BASE = 'https://api.paytrigo.net'; const API_KEY = 'sk_live_EQRe18nZCjXZSv8BmSJMs5mYvMOw1wgDd2RHnOH5T28'; ``` The credentials are automatically placed into authorization headers: ```js const createHeaders = { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json', 'Idempotency-Key': idempotency, }; ``` ### Technical Analysis Two distinct live platform API keys are embedded directly in distributed source files. Any user who can download, inspect, cache, or obtain a copy of the Skill can recover these bearer credentials without authentication. Embedding a shared live credential prevents effective caller attribution, per-user revocation, secure rotation, and least-privilege access control. The keys are also transmitted whenever the scripts create invoices, so compromise of the source credential grants the same API access outside the Skill. This network use is necessary for the declared PayTrigo workflow, but distributing reusable platform credentials is not necessary and exceeds a minimum-privilege design. Each deployment should instead supply its own scoped credential through a protected secret channel. ### Attack Path 1. An attacker downloads or otherwise obtains the Skill source. 2. The attacker searches the scripts for `sk_live_` values. 3. The attacker extracts either hard-coded bearer credential. 4. The ...[truncated 723 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Revoke both exposed live keys immediately and review their API activity. 2. Remove all credentials from source code and repository history. 3. Require a credential through a protected environment variable, operating-system keychain, or secret manager. 4. Issue separate, narrowly scoped keys for each deployment or user. 5. Apply server-side restrictions such as permitted operations, recipient allowlists, rate limits, expiration, and usage monitoring. 6. Fail closed when no credential is configured; do not retain a shared fallback key. 7. Add secret-scanning checks to CI and pre-commit workflows. 8. Avoid writing credentials or authorization headers to logs and error messages. ]]>
