[PR #18963] [CLOSED] Fix SSRF vulnerability in web fetch endpoint (GHSA-c6xv-rcvw-v685) #48084

Closed
opened 2026-04-29 23:36:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/18963
Author: @teolines
Created: 11/6/2025
Status: ❌ Closed

Base: dev ← Head: fix/ssrf-ghsa-c6xv-rcvw-v685


📝 Commits (1)

  • 1235ca8 Fix SSRF vulnerability in web fetch endpoint (GHSA-c6xv-rcvw-v685)

📊 Changes

4 files changed (+284 additions, -0 deletions)

View changed files

📝 backend/open_webui/config.py (+19 -0)
📝 backend/open_webui/main.py (+6 -0)
➕ backend/open_webui/retrieval/ssrf_protection.py (+207 -0)
📝 backend/open_webui/routers/retrieval.py (+52 -0)

📄 Description

Description

This PR fixes the SSRF (Server-Side Request Forgery) vulnerability reported in GHSA-c6xv-rcvw-v685.

Changes

  • Add SSRF protection module with configurable blocklists
  • Block cloud metadata endpoints by default (AWS, GCP, Azure, Alibaba Cloud, Oracle Cloud, DigitalOcean)
  • Add protocol restrictions (HTTP/HTTPS only)
  • Add DNS resolution validation
  • Maintain backward compatibility with optional IP range blocking via environment variables

Security Impact

Fixes CWE-918: Server-Side Request Forgery vulnerability that could allow attackers to access internal network resources and cloud metadata endpoints through the web fetch functionality.

Configuration

Admins can customize the protection via environment variables:

# Enable/disable SSRF protection (default: true)
ENABLE_SSRF_PROTECTION=true

# Block custom hostnames (comma-separated)
SSRF_BLOCKED_HOSTNAMES=169.254.169.254,metadata.google.internal,evil.com

# Block custom IP ranges (comma-separated CIDR notation)
SSRF_BLOCKED_IP_RANGES=127.0.0.0/8,::1/128,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12

Backward Compatibility

  • Protection is enabled by default for security
  • Cloud metadata endpoints are blocked by default
  • Private IP ranges (localhost, 192.168.x.x, 10.x.x.x) are NOT blocked by default to maintain compatibility with existing deployments
  • Admins can enable stricter blocking via configuration if needed

Files Changed

  • backend/open_webui/retrieval/ssrf_protection.py - New SSRF protection module
  • backend/open_webui/config.py - Add configuration options
  • backend/open_webui/main.py - Register configuration in app state
  • backend/open_webui/routers/retrieval.py - Integrate SSRF validation in web fetch endpoint

References

  • Security: Fixes GHSA-c6xv-rcvw-v685 (CWE-918)
  • Reported-by: @teorepo

I agree to the Contributor License Agreement


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/18963 **Author:** [@teolines](https://github.com/teolines) **Created:** 11/6/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `fix/ssrf-ghsa-c6xv-rcvw-v685` --- ### 📝 Commits (1) - [`1235ca8`](https://github.com/open-webui/open-webui/commit/1235ca8a4f8d983336ec288df04de148bd9afafd) Fix SSRF vulnerability in web fetch endpoint (GHSA-c6xv-rcvw-v685) ### 📊 Changes **4 files changed** (+284 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+19 -0) 📝 `backend/open_webui/main.py` (+6 -0) ➕ `backend/open_webui/retrieval/ssrf_protection.py` (+207 -0) 📝 `backend/open_webui/routers/retrieval.py` (+52 -0) </details> ### 📄 Description ## Description This PR fixes the SSRF (Server-Side Request Forgery) vulnerability reported in GHSA-c6xv-rcvw-v685. ## Changes - Add SSRF protection module with configurable blocklists - Block cloud metadata endpoints by default (AWS, GCP, Azure, Alibaba Cloud, Oracle Cloud, DigitalOcean) - Add protocol restrictions (HTTP/HTTPS only) - Add DNS resolution validation - Maintain backward compatibility with optional IP range blocking via environment variables ## Security Impact Fixes CWE-918: Server-Side Request Forgery vulnerability that could allow attackers to access internal network resources and cloud metadata endpoints through the web fetch functionality. ## Configuration Admins can customize the protection via environment variables: ```bash # Enable/disable SSRF protection (default: true) ENABLE_SSRF_PROTECTION=true # Block custom hostnames (comma-separated) SSRF_BLOCKED_HOSTNAMES=169.254.169.254,metadata.google.internal,evil.com # Block custom IP ranges (comma-separated CIDR notation) SSRF_BLOCKED_IP_RANGES=127.0.0.0/8,::1/128,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12 ``` Backward Compatibility - Protection is enabled by default for security - Cloud metadata endpoints are blocked by default - Private IP ranges (localhost, 192.168.x.x, 10.x.x.x) are NOT blocked by default to maintain compatibility with existing deployments - Admins can enable stricter blocking via configuration if needed Files Changed - backend/open_webui/retrieval/ssrf_protection.py - New SSRF protection module - backend/open_webui/config.py - Add configuration options - backend/open_webui/main.py - Register configuration in app state - backend/open_webui/routers/retrieval.py - Integrate SSRF validation in web fetch endpoint References - Security: Fixes GHSA-c6xv-rcvw-v685 (CWE-918) - Reported-by: @teorepo I agree to the Contributor License Agreement --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 23:36:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#48084