T09 · Insecure Skill Coding Practices
- Location
index.js:54- Finding
Hard-Coded Wavespeed API Credential in Distributed Source Code
- Content
View full analysis
" } }; ``` The original source contains a complete Wavespeed API key at the redacted location. ### Technical Analysis A production API credential is embedded directly in the distributed JavaScript source. Environment-variable authentication is used by the exported function, but the local test block bypasses that control by constructing a context containing a fixed credential. Source code and packaged skill files are not suitable secret-storage mechanisms. Anyone who can download, inspect, cache, or obtain a copy of the package can recover the credential without needing access to the legitimate deployment environment. ### Attack Path 1. An attacker downloads or otherwise obtains the skill package. 2. The attacker opens `index.js` and extracts the hard-coded value assigned to `WAVESPEED_API_KEY`. 3. The attacker supplies that value as a bearer token in requests to the Wavespeed API. 4. Requests are charged to or processed under the account associated with the exposed credential. 5. The attacker can continue using the credential until it is revoked, rotated, or otherwise invalidated. ### Impact Assessment Successful exploitation does not grant local operating-system privileges, but it may grant the attacker the Wavespeed API privileges associated with the exposed key. Potential consequences include: - Unauthorized image-generation requests. - Consumption of API quotas or paid credits. - Rate-limit exhaustion and denial of service to the legitimate user. - Access to any additional Wavespeed resources authorized for the same credential. - Reputational or account consequences arising from abusive requests. The exact account-level scope depends on the permissions assigned to the exposed API key. ]]>- Remediation
View remediation
