T09 · Insecure Skill Coding Practices
- Location
scripts/scrape.ts:82- Finding
Server-Side Request Forgery Through Unrestricted Listing URL Navigation
- Content
View full analysis
{ await browser.goto(url); const deadline = Date.now() + timeoutMs; ``` ```ts async function main(): Promise { const url = process.argv[2]; if (!url || !/^https?:\/\//i.test(url)) { toolError("usage: node scrape.ts ''"); return; } // Read before opening the browser. This is the guard: a missing or damaged // store fails here with an actionable message, rather than after the scrape, // the geocode, and a photo download that has already written an image. // It also gives us what this property looked like before the refresh. const dir = resolveDataDir(); const before = readStore(dir); const { connect } = require('plow-browser'); let browser: any; try { browser = connect(process.env.CAMOUFOX_RPC_ENDPOINT); } catch (err) { if ((err as Error & { name?: string })?.name === 'BrowserNotConnected') { return toolError('browser unavailable: endpoint not provisioned — enable Plow Browser in Settings'); } throw err; } const { scraped, photoUrl } = await scrapeRendered(browser, url); ``` ### Technical Analysis The command accepts a user-controlled listing URL and verifies only that its textual form begins with `http://` or `https://`. It does not reject loopback, RFC1918 private, link-local, carrier-grade NAT, IPv6 local, or cloud instance metadata destinations before passing the URL to `browser.goto()`. The project already implements robust destination validation for hero-image downloads through `resolvePublicDestination()`, including private-address rejection and DNS-rebinding mitigation. That protection is ...[truncated 2746 chars]- Remediation
View remediation
