T09 · Insecure Skill Coding Practices
- Location
scripts/utils.js:136- Finding
Unrestricted HTTP Fetching Enables Server-Side Request Forgery
- Content
View full analysis
_fetchAndExtract(url.toString(), maxLen); ``` ```js async function _fetchAndExtract(url, maxLen) { let html; let finalUrl = url; try { const response = await fetch(url, { headers: { "User-Agent": "Mozilla/5.0 (compatible; BraveSearchBot/2.0; +https://github.com/kelexine)", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.9", "Accept-Encoding": "gzip, deflate, br", }, signal: AbortSignal.timeout(config.FETCH_TIMEOUT_MS), redirect: "follow", }); ``` ### Technical Analysis The URL validator only restricts the protocol to HTTP or HTTPS. It does not reject destinations resolving to: - IPv4 or IPv6 loopback addresses - RFC1918 private network ranges - Link-local addresses - Internal DNS names - Reserved or special-use address ranges - Cloud metadata and other infrastructure-local addresses Mo ...[truncated 2199 chars]- Remediation
View remediation
