T09 · Insecure Skill Coding Practices
- Location
scripts/pixelletter.mjs:6- Finding
Unrestricted API Endpoint Override Enables Credential and Document Exfiltration
- Content
View full analysis
${authXml({ email, password, production: Boolean(args.production) })} ${commandXml} `; } ``` ```js async function submit(payload) { const form = new FormData(); form.append('xml', payload.xml); for (let i = 0; i < payload.files.length; i++) { const file = payload.files[i]; const buffer = await readFile(file); form.append(`uploadfile${i}`, new Blob([buffer], { type: 'application/pdf' }), basename(file)); } const response = await fetch(ENDPOINT, { method: 'POST', body: form }); const body = await response.text(); if (!response.ok) throw new Error(`HTTP ${response.status}: ${body.slice(0, 500)}`); return body; } ``` ### Technical Analysis The destination for all API requests can be changed through the undocumented `PIXELLETTER_ENDPOINT` environment variable. The value is passed directly to `fetch()` without validating its protocol, hostname, port, or origin. For non-dry-run operations, the XML payload contains the values of `PIXELLETTER_EMAIL` and `PIXELLETTER_PASSWORD`. Text orders additionally contain recipient addresses and message contents, while upload orders attach complete user-selected documents. Consequently, redirecting the endpoint redirects all of this sensitive data. The implementation also accepts a plain H ...[truncated 1916 chars]- Remediation
View remediation
