[PR #22564] [CLOSED] fix: respect FORWARDED_ALLOW_IPS env var instead of hardcoding '*' in start scripts #42387

Closed
opened 2026-04-25 14:17:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22564
Author: @NIK-TIGER-BILL
Created: 3/11/2026
Status: Closed

Base: mainHead: fix/forwarded-allow-ips-env-var-ignored


📝 Commits (1)

  • 12c3088 fix: respect FORWARDED_ALLOW_IPS env var instead of hardcoding '*' in start scripts

📊 Changes

2 files changed (+5 additions, -4 deletions)

View changed files

📝 backend/start.sh (+2 -2)
📝 backend/start_windows.bat (+3 -2)

📄 Description

Problem

backend/start.sh and backend/start_windows.bat both hardcode --forwarded-allow-ips '*', ignoring the FORWARDED_ALLOW_IPS environment variable entirely (closes #22539).

This affects operators running Open WebUI behind a trusted reverse proxy who want to restrict which upstream IPs are allowed to set forwarded headers — e.g.:

FORWARDED_ALLOW_IPS='10.0.0.1,10.0.0.2'  # internal proxy only

With the hardcoded '*', every host is unconditionally trusted regardless of this setting.

Fix

backend/start.sh

Use shell parameter expansion with default:

# Before
--forwarded-allow-ips '*'

# After
--forwarded-allow-ips "${FORWARDED_ALLOW_IPS:-*}"

backend/start_windows.bat

Set a default value then reference the variable:

IF "%FORWARDED_ALLOW_IPS%"=="" SET FORWARDED_ALLOW_IPS=*
uvicorn ... --forwarded-allow-ips "%FORWARDED_ALLOW_IPS%" ...

Both changes are backwards-compatible: if FORWARDED_ALLOW_IPS is not set, * is used as the default, preserving the existing behaviour.

Closes #22539


🔄 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/22564 **Author:** [@NIK-TIGER-BILL](https://github.com/NIK-TIGER-BILL) **Created:** 3/11/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/forwarded-allow-ips-env-var-ignored` --- ### 📝 Commits (1) - [`12c3088`](https://github.com/open-webui/open-webui/commit/12c3088f28a2bd8e0beec73d0bc6292d48e6d223) fix: respect FORWARDED_ALLOW_IPS env var instead of hardcoding '*' in start scripts ### 📊 Changes **2 files changed** (+5 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `backend/start.sh` (+2 -2) 📝 `backend/start_windows.bat` (+3 -2) </details> ### 📄 Description ## Problem `backend/start.sh` and `backend/start_windows.bat` both hardcode `--forwarded-allow-ips '*'`, ignoring the `FORWARDED_ALLOW_IPS` environment variable entirely (closes #22539). This affects operators running Open WebUI behind a trusted reverse proxy who want to restrict which upstream IPs are allowed to set forwarded headers — e.g.: ```bash FORWARDED_ALLOW_IPS='10.0.0.1,10.0.0.2' # internal proxy only ``` With the hardcoded `'*'`, every host is unconditionally trusted regardless of this setting. ## Fix ### `backend/start.sh` Use shell parameter expansion with default: ```bash # Before --forwarded-allow-ips '*' # After --forwarded-allow-ips "${FORWARDED_ALLOW_IPS:-*}" ``` ### `backend/start_windows.bat` Set a default value then reference the variable: ```batch IF "%FORWARDED_ALLOW_IPS%"=="" SET FORWARDED_ALLOW_IPS=* uvicorn ... --forwarded-allow-ips "%FORWARDED_ALLOW_IPS%" ... ``` Both changes are **backwards-compatible**: if `FORWARDED_ALLOW_IPS` is not set, `*` is used as the default, preserving the existing behaviour. Closes #22539 --- <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-25 14:17:58 -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#42387