T09 · Insecure Skill Coding Practices
- Location
scripts/utils/validator.js:3- Finding
Arbitrary URL Downloads Enable Server-Side Request Forgery
- Content
View full analysis
this.__opts.maxRedirects) { const err = new Error("Too many redirects"); this.__setState(this.__states.FAILED); this.emit("error", err); return reject(err); } const redirectedURL = /^https?:\/\//.test(response.headers.location) ? response.headers.location : new URL(response.headers.location, this.url).href; this.__isRedirected = true; this.__initProtocol(redirectedURL); ``` ### Technical Analysis URL validation only verifies that the supplied value uses HTTP or HTTPS. It does not resolve and inspect the destination address or reject loopback, private, link-local, unspecified, multicast, IPv6-local, or cloud metadata addresses. The downloader also follows HTTP redirects without applying destination restrictions to each redirected URL. Consequently, a public URL can redirect to an otherwise internal destination. DNS rebinding may provide another bypass if validation is added only before DNS ...[truncated 1765 chars]- Remediation
View remediation
