T09 · Insecure Skill Coding Practices
- Location
scripts/download.mjs:43- Finding
Unrestricted Server-Controlled URL Fetching Enables SSRF
- Content
View full analysis
[item.chunkIndex, item.url])) const noncePrefix = fromBase64Url(file.noncePrefix) const fileHandle = await open(destination, 'w') try { for (let chunkIndex = 0; chunkIndex < file.totalChunks; chunkIndex += 1) { const url = urlMap.get(chunkIndex) if (!url) { throw new Error(`Missing download URL for ${file.relativePath} chunk ${chunkIndex}.`) } const response = await fetch(url) ``` ### Technical Analysis The downloader obtains `manifestUrl` and individual chunk URLs from the selected Xdrop API server and passes them directly to `fetch`. It does not constrain the URL scheme, hostname, port, resolved IP address, or redirect destination. Consequently, a malicious or compromised Xdrop server can cause the process to issue HTTP requests to destinations other than the server the user selected. Potential targets include loopback services, private network hosts, link-local endpoints, and cloud instance metadata services. The fetched content is subsequently treated as encrypted transfer data, and decryption should normally fail for unrelated responses. This limits direct ...[truncated 1561 chars]- Remediation
View remediation
