T09 · Insecure Skill Coding Practices
- Location
scripts/utils/validator.js:3- Finding
Unrestricted URL Fetching Enables 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); this.emit("redirected", redirectedURL, this.url); return this.__start(); } ``` ### Technical Analysis The URL validator checks only whether the input uses HTTP or HTTPS. It does not reject loopback, private, link-local, reserved, multicast, or cloud metadata addresses. It also does not resolve and inspect hostnames before connecting. The downloader follows up to ten redirects without applying a network-address policy to each new target. A public endpoint can ...[truncated 1749 chars]- Remediation
View remediation
