T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/run.mjs:24
- Finding
- API Credential Sent in Request Bodies to an Undisclosed Cross-Brand Domain<![CDATA[ ## Vulnerability Details **File Location**: `scripts/run.mjs:3, 24-40, 62-66, 105-109, 142-146` **Vulnerability Type**: API credential exposure through request-body authentication and insufficient endpoint disclosure **Risk Level**: High ### Complete Code Snippet ```js const API_BASE = "https://api.heybossai.com/v1"; ``` ```js const apiKey = (process.env.SKILLBOSS_API_KEY ?? "").trim(); if (!apiKey) { console.error("Missing SKILLBOSS_API_KEY. Get one at https://www.skillboss.co"); process.exit(1); } const cmd = args[0]; if (cmd === "models") { const body = { api_key: apiKey }; if (args[1]) body.types = args[1]; const resp = await fetch(`${API_BASE}/models`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body), }); ``` The same request-body authentication pattern is used by the model execution and task endpoints: ```js body: JSON.stringify({ api_key: apiKey, model, inputs }), ``` ```js body: JSON.stringify({ api_key: apiKey, type, inputs }), ``` ```js body: JSON.stringify({ api_key: apiKey, discover: true }), ``` ### Technical Analysis The Skill documentation directs users to obtain `SKILLBOSS_API_KEY` from `https://www.skillboss.co`, but the executable sends that credential to the separately branded host `api.heybossai.com`. The reviewed documentation does not explain the relationship between these domains or explicitly disclose that the API key will be delivered to the latter. The key is included in the JSON request body instead of a standard authorization header. HTTPS protects the credential in transit against ordinary passive interception, but request bodies are more likely to be recorded by application logging, API debugging, reverse-proxy inspection, error telemetry, or request tracing. This expands the number of systems in which the credential may be retained. Every supported command requires and transmits the key, including discovery-only operations such as `models ...[truncated 1343 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Verify and document the ownership and operational relationship between `skillboss.co` and `api.heybossai.com`. 2. Prefer an official, same-brand API hostname covered by the provider's published privacy and security documentation. 3. Move authentication out of the JSON body and into a standard header, for example: ```js headers: { "Content-Type": "application/json", "Authorization": `Bearer ${apiKey}`, } ``` 4. Ensure reverse proxies, application servers, observability systems, and error telemetry redact authorization values. 5. Use narrowly scoped, revocable API credentials with spending and rate limits where supported. 6. Document the destination hostname before installation or execution so users can make an informed trust decision. 7. Consider enforcing an explicit endpoint allowlist and certificate-validation policy. Do not permit untrusted runtime input to replace the API endpoint. 8. Avoid returning raw remote error bodies where they could reveal internal service details; parse and sanitize errors before presenting them. ]]>
