T09 · Insecure Skill Coding Practices
- Location
scripts/image_toolkits.js:19- Finding
Unrestricted API base URL can disclose the API key and image data to an attacker-controlled host
- Content
View full analysis
controller.abort(), 30000); try { const res = await fetch(url, { method, headers, body: body != null ? JSON.stringify(body) : undefined, signal: controller.signal, }); ``` ### Technical Analysis The `WERYAI_BASE_URL` environment variable is accepted without validating its protocol or hostname. The resulting value controls the destination of upload, submission, and status requests. These requests include the production `WERYAI_API_KEY` in an `Authorization: Bearer` header. Consequently, a configuration error or environment-variable injection can redirect credentials, request parameters, prompts, and uploaded image contents to an arbitrary server. An `http://` URL is also accepted, allowing sensitive information to be transmitted without transport encryption. The documentation in `SKILL.md:76` advises users to select a trusted host, but documentation is not an effective security boundary. The executable must enforce destination restrictions before transmitting credentials. Remote processing is necessary for the declared Skill functionality, but transmitting the credenti ...[truncated 1352 chars]- Remediation
View remediation
