The vulnerability is a Server-Side Request Forgery (SSRF) caused by the application's HTTP clients following HTTP redirects by default. The core of the issue is that while the application validates the initial URL provided by the user to prevent requests to internal or private IP addresses, it fails to perform the same validation on the URLs provided in Location headers during an HTTP 3xx redirect. An attacker can exploit this by providing a seemingly safe, public URL that redirects to a sensitive internal endpoint (e.g., 127.0.0.1, cloud metadata services like 169.254.169.254, or other services on the local network). The server, upon receiving the redirect, would then make a request to the internal service and return its response to the attacker.
The analysis of the patches between the vulnerable version 0.9.4 and the patched version 0.9.5 confirms this root cause. The patches consistently add allow_redirects=False to HTTP client calls across multiple code paths. The identified vulnerable functions are those that were making HTTP requests without this parameter set. Specifically:
get_content_from_url in backend/open_webui/retrieval/utils.py used requests.get.
SafeWebBaseLoader in backend/open_webui/retrieval/web/utils.py inherited a vulnerable _scrape method, which was fixed by modifying the constructor to disable redirects.
load_url_image in backend/open_webui/routers/images.py used aiohttp.ClientSession.get.
get_image_base64_from_url in backend/open_webui/utils/files.py, used in the chat functionality, also used aiohttp.ClientSession.get.
By disabling redirects in these key functions, the patch ensures that only the initially validated URL is ever contacted, thus closing the SSRF loophole.