T09 · Insecure Skill Coding Practices
- Location
references/crawling-guide.md:110- Finding
Unrestricted URL Fetching Enables Server-Side Request Forgery and Unsafe Browser Navigation
- Content
View full analysis
str: headers = {"User-Agent": "Mozilla/5.0"} resp = requests.get(url, headers=headers, timeout=30) soup = BeautifulSoup(resp.text, "html.parser") elem = soup.select_one(selector) or soup.body return elem.get_text(separator="\n", strip=True) ``` From `references/crawling-guide.md:205-215`: ```javascript // Node.js playwright path (built into Hermes Agent) const {chromium} = require('/home/yhongm/.hermes/hermes-agent/node_modules/playwright'); const browser = await chromium.launch({ headless: true, args: ['--no-sandbox', '--disable-gpu'] }); const page = await browser.newPage(); await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 }); await page.waitForTimeout(8000); const text = await page.innerText('body'); ``` ### Technical Analysis The crawling examples accept a URL and pass it directly to `requests.get()` or `page.goto()` without enforcing a trusted scheme, host, port, or resolved-address policy. There is no protection against URLs resolving to: - Loopback addresses such as `127.0.0.1` or `::1` - RFC 1918 private networks - Link-local addresses - Cloud instance metadata services - Internal DNS names - Redirects from a public host to an internal address If an untrusted user can influence the documentation source URL, these examples create a server-side request forgery primitive from the environment running the Skill. The browser example also launches Chromium with `--no-sandbox`, unnecessarily weakening process isolation when visiting potentially hostile pages. Time ...[truncated 1660 chars]- Remediation
View remediation
