T09 · Insecure Skill Coding Practices
- Location
scripts/seedream.js:143- Finding
Unrestricted API Endpoint Override Can Exfiltrate Credentials and Image Data in JavaScript
- Content
View full analysis
' : undefined } })); const dataString = JSON.stringify(payload); const options = { hostname: parsedUrl.hostname, port: parsedUrl.port || 443, path: parsedUrl.pathname + parsedUrl.search, method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(dataString) } }; ``` ### Technical Analysis The destination of the authenticated API request is taken directly from the `SEEDREAM_BASE_URL` environment variable. The code does not verify that the destination belongs to Volcengine or another explicitly trusted host before adding the `SEEDREAM_API_KEY` bearer credential. The request payload can also contain the user's prompt and complete base64-encoded contents of every local image supplied through the `image` parameter. Consequently, an untrusted endpoint receives both authentication material and potentially private input data. Although the JavaScript implementation uses `https.request`, which establishes TLS, TLS only protects the connection to the selected host. It does not establish that the selected host is authorized to receive the Seedream credential or image data. ### Attack Path 1. An attacker influences process configuration, a launcher, CI environment, deployment man ...[truncated 1093 chars]- Remediation
View remediation
