T09 · Insecure Skill Coding Practices
- Location
src/extractors/BrowserManager.ts:22- Finding
Unrestricted URL Navigation Enables Server-Side Request Forgery
- Content
View full analysis
{ const page = await this.newPage(); try { await page.goto(url, { waitUntil: 'networkidle' }); ``` The CLI accepts the navigation target without validation: ```ts case '--url': case '-u': options.url = args[++i]; break; ``` ### Technical Analysis The user-controlled URL is passed directly to Playwright's `page.goto()` method. The implementation does not validate the URL scheme, hostname, resolved IP addresses, port, or redirect destinations. Because the request originates from the machine running the Skill, an attacker who can control the URL may direct Chromium to resources that are inaccessible from the attacker's own network position. Relevant targets include: - Loopback services such as `127.0.0.1` and `::1` - RFC 1918 private networks - Link-local services and cloud instance metadata endpoints - Internal administrative panels or development services - Public URLs that redirect to private destinations After navigation, the Skill extracts `document.body.innerText`, selected page text, or table content and returns it to the caller. This creates a response-reading SSRF condition rather than merely a blind request primitive. ### Attack Path 1. An attacker supplies an internal target, for example `http://127.0.0.1:8080/admin`, as the `--url` argument or through the exported `SmartScraper.scrape()` API. 2. `src/cli.ts` stores the value in `options.url` without validation. 3. `SmartScraper.scrape()` passes the URL to `BrowserManager.scrapePage()`. 4. Headless Chromium sends the request from the Skill host's network context. 5. The extractor reads the result ...[truncated 781 chars]- Remediation
View remediation
