T09 · Insecure Skill Coding Practices
- Location
run.py:128- Finding
Unvalidated URL Fetching Enables Server-Side Request Forgery
- Content
View full analysis
str: """Fetch webpage content through mcporter and BrowserOS.""" try: cmd = ["mcporter", "call", "browseros.get_page_content", f"url={url}"] result = subprocess.run( cmd, capture_output=True, text=True, timeout=timeout, encoding='utf-8', errors='ignore' ) ``` The URL reaches this function directly from the user-supplied results file: ```python title = item.get("title") or "" url = item.get("url") or "" content = item.get("content") or "" if not content and fetch_content and url and url != "N/A": print(f" Fetching content from: {url}") content = fetch_page_content(url) if content: item["content"] = content[:8000] ``` ### Technical Analysis The Skill accepts a path to a JSON file and reads each result's `url` field without validating its scheme, hostname, resolved IP address, port, or redirect destination. The URL is then passed to the externally installed BrowserOS tool. Using an argument array for `subprocess.run` prevents conventional shell metacharacter injection, but it does not constrain where BrowserOS may connect. Depending on BrowserOS protocol support and network placement, a crafted URL could target: - Loopback services such as `127.0.0.1` or `::1` - RFC 1918 private-network hosts - Link-local services and cloud metadata endpoints - Internal administrative applications - Non-HTTP schemes supported by the browser backend - A public URL that redirects to a prohibited internal destination This exceeds the minimum network privilege needed to research public web sources. The declared functionality requires access to public webpages, not arbitrary access to the host's internal or p ...[truncated 1430 chars]- Remediation
View remediation
