mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-30 17:25:30 -05:00
[PR #24672] [CLOSED] fix(images): add null-check in upload_image to prevent crash on SSRF block #98808
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24672
Author: @mturac
Created: 5/13/2026
Status: ❌ Closed
Base:
dev← Head:fix/comfyui-image-upload-crash📝 Commits (10+)
fe6783cMerge pull request #19030 from open-webui/devfc05e0aMerge pull request #19405 from open-webui/deve3faec6Merge pull request #19416 from open-webui/dev9899293Merge pull request #19448 from open-webui/dev140605eMerge pull request #19462 from open-webui/dev6f1486fMerge pull request #19466 from open-webui/devd95f533Merge pull request #19729 from open-webui/deva7271530.6.43 (#20093)6adde20Merge pull request #20394 from open-webui/devf9b0534Merge pull request #20522 from open-webui/dev📊 Changes
1 file changed (+10 additions, -0 deletions)
View changed files
📝
backend/open_webui/routers/images.py(+10 -0)📄 Description
Contributor License Agreement
By submitting this pull request, I confirm that I have read and agree to the Contributor License Agreement.
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.