Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix: validate URL scheme in fetch_webpage to reject file:// URLs (#8889)
github-actions[bot]90f3ab91843a
diff --git a/letta/services/tool_executor/builtin_tool_executor.py b/letta/services/tool_executor/builtin_tool_executor.pyindex b2ae6bb82..ea248bf3f 100644--- a/letta/services/tool_executor/builtin_tool_executor.py+++ b/letta/services/tool_executor/builtin_tool_executor.py@@ -320,12 +320,21 @@ class LettaBuiltinToolExecutor(ToolExecutor):String containing the webpage content in markdown/text format"""import asyncio+ from urllib.parse import urlparseimport html2textimport requestsfrom readability import Documentfrom trafilatura import extract, fetch_url+ # Validate URL scheme - only HTTP and HTTPS are supported+ parsed_url = urlparse(url)+ if parsed_url.scheme.lower() not in ("http", "https"):+ raise ValueError(+ f"Invalid URL scheme '{parsed_url.scheme}'. Only 'http' and 'https' URLs are supported. "+ f"Local file paths (file://) and other protocols cannot be fetched."+ )+# Try exa firsttry:from exa_py import Exa