T09 · Insecure Skill Coding Practices
- Location
agent-scraper.js:12- Finding
Unrestricted Browser Navigation Enables Server-Side Access to Internal Resources
- Content
View full analysis
Vulnerability Details
File Location:
agent-scraper.js:12-13,agent-scraper.js:51-53
Vulnerability Type: Unrestricted URL navigation / browser-assisted SSRF
Risk Level: HighVulnerable Code
js const url = process.argv[2]; const userInstruction = process.argv[3];js console.log(`[+] 正在导航至: ${url}`); await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 }); await page.waitForTimeout(3000);Technical Analysis
The destination URL is obtained directly from a command-line argument and passed to Playwright's
page.goto()without validation. The implementation does not restrict schemes, approved hostnames, ports, resolved IP addresses, redirects, loopback addresses, link-local addresses, or private network ranges.Because navigation originates from the browser's execution environment, a caller may use the tool to request resources reachable from the container or host network but not reachable from the public Internet. The AI-controlled browser can subsequently inspect and interact with the loaded page, increasing the risk that internal content will appear in the task result.
Attack Path
- An attacker or untrusted caller supplies a URL targeting a loopback, private-network, link-local, or cloud metadata address.
- The script accepts the URL without checking its scheme or resolved address.
- Chromium sends the request from the container's network context.
- If the resource is reachable, the page is made available to
AgentBrowser. - The supplied instruction directs the agent to inspect or interact with the internal resource.
- Retrieved content or operation results may be returned through the serialized agent result.
Redirects can also be used to bypass a superficial hostname-only policy unless every redirect destination is validated.
Impact Assessment
Exploitation may permit:
- Discovery of internal web applications and network services ...[truncated 515 chars]
- Remediation
View remediation
Remediation Suggestions
- Accept only explicitly required schemes, preferably
https:. - Implement an allowlist of approved destination domains rather than a denylist.
- Resolve the hostname before navigation and reject loopback, private, link-local, multicast, reserved, and metadata address ranges for both IPv4 and IPv6.
- Validate every redirect destination using the same policy.
- Reject URLs containing embedded credentials or unexpected ports.
- Apply container-level egress filtering so application validation is not the only control.
- Run scraping jobs in an isolated network namespace with no access to internal services or cloud metadata.
- Log normalized destinations and rejected navigation attempts without logging credentials.
- Accept only explicitly required schemes, preferably
