We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e2b0b6 commit 665f95eCopy full SHA for 665f95e
1 file changed
backend/open_webui/utils/files.py
@@ -18,6 +18,7 @@
18
from open_webui.models.chats import Chats
19
from open_webui.models.files import Files
20
from open_webui.routers.files import upload_file_handler
21
+from open_webui.retrieval.web.utils import validate_url
22
23
import mimetypes
24
import base64
@@ -33,6 +34,8 @@
33
34
def get_image_base64_from_url(url: str) -> Optional[str]:
35
try:
36
if url.startswith("http"):
37
+ # Validate URL to prevent SSRF attacks against local/private networks
38
+ validate_url(url)
39
# Download the image from the URL
40
response = requests.get(url)
41
response.raise_for_status()
0 commit comments