mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-22 06:02:06 -05:00
[PR #1862] [MERGED] feat: add ENABLE_LOCAL_WEB_FETCH to protect against SSRF attacks #7613
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/1862
Author: @cheahjs
Created: 4/29/2024
Status: ✅ Merged
Merged: 4/29/2024
Merged by: @tjbck
Base:
dev← Head:feat/filter-local-rag-fetch📝 Commits (1)
1c4e63ffeat: add ENABLE_LOCAL_WEB_FETCH to protect against SSRF attacks📊 Changes
4 files changed (+45 additions, -1 deletions)
View changed files
📝
backend/apps/rag/main.py(+38 -1)📝
backend/config.py(+2 -0)📝
backend/constants.py(+4 -0)📝
backend/requirements.txt(+1 -0)📄 Description
Pull Request Checklist
Description
As the web RAG feature makes arbitrary URL requests on behalf of the user, it is vulnerable to server-side request forgery. Add a new env var
ENABLE_LOCAL_WEB_FETCHthat defaults to false to attempt to mitigate SSRF attempts at making requests to addresses in the private IP address ranges. Users can enable this if necessary (for example, accessing a self-hosted company knowledgebase), but they should be aware of the risks and mitigate with firewall rules.Changelog Entry
Added
ENABLE_LOCAL_WEB_FETCHto mitigate server-side request forgery (SSRF) by restricting web fetches to non-private IP addresses unless explicitly enabled.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.