mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-24 11:58:31 -05:00
[PR #24671] [CLOSED] fix(images): add null-check in upload_image to prevent crash on SSRF block #131435
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24671
Author: @mturac
Created: 5/13/2026
Status: ❌ Closed
Base:
main← Head:fix/comfyui-image-upload-crash📝 Commits (1)
b60ea13fix(images): add null-check in upload_image to prevent crash on SSRF block📊 Changes
1 file changed (+10 additions, -0 deletions)
View changed files
📝
backend/open_webui/routers/images.py(+10 -0)📄 Description
Summary
When
get_image_datareturns(None, None)due to an SSRF block (e.g., ComfyUI on private IP like192.168.x.x),upload_imagecrashes with'NoneType' object has no attribute 'lower'inmimetypes.guess_extension.This is a regression from PR #24518 which added
validate_url()to prevent SSRF attacks. While the security fix is important, it broke ComfyUI deployments on private networks.Fix
Add a null-check at the start of
upload_imagethat raises a descriptiveHTTPExceptionpointing users to theENABLE_RAG_LOCAL_WEB_FETCHworkaround.Changes
backend/open_webui/routers/images.py: Added null-check inupload_image()functionTesting
upload_imagenow raises a 400 error with a helpful message instead of crashingENABLE_RAG_LOCAL_WEB_FETCH=trueRelated
ENABLE_RAG_LOCAL_WEB_FETCH=trueFixes #24565
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.