mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #15881] issue: WEBUI_AUTH_TRUSTED_EMAIL_HEADER=Cf-Access-Authenticated-User-Email brakes in 0.6.16 #17704
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?
Originally created by @drejom on GitHub (Jul 19, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/15881
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.16,17,18
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
Chrome/Safari
Confirmation
README.md.Expected Behavior
After a recent update to OpenWebUI, I expected the application to continue functioning as it had previously when accessed via a Cloudflare Tunnel (Zero Trust). It should load the UI correctly and allow interaction with the backend and models, with no CSP violations or 500 internal errors.
Actual Behavior
When accessing the app via a custom domain proxied through a Cloudflare Tunnel, the UI fails to load and returns a 500 error. Browser console logs show multiple Content Security Policy (CSP) violations.
This behavior started after upgrading from version 0.6.15 to newer versions (including 0.6.16, 0.6.17, and 0.6.18). Reverting to 0.6.15 restores full functionality with the same setup.
Steps to Reproduce
Deploy OpenWebUI in Docker using version 0.6.16 or later.
Expose the container using cloudflared, connecting to a Cloudflare Zero Trust tunnel.
Set a custom domain to proxy through Cloudflare to the cloudflared container.
Access the OpenWebUI URL via your custom domain.
Observe:
Blank UI or error page.
500 errors in browser console.
CSP errors related to scripts, fonts, and workers.
Logs & Screenshots
Refused to load the script from Cloudflare Insights because it violates the CSP directive:
"default-src 'self' 'unsafe-inline' 'unsafe-eval'".
Refused to load a base64-encoded font because it violates the same directive.
Refused to create a worker from a blob URL because 'worker-src' was not explicitly set.
SecurityError: Failed to construct 'Worker': Access to the script at blob: is denied by the document's Content Security Policy.
OpenWebUI container logs: No relevant traceback, even with GLOBAL_LOG_LEVEL=DEBUG.
Additional Information
This setup worked perfectly with no modifications up through 0.6.15. All networking and access controls are managed through Cloudflare's Zero Trust policies, with no rate limiting or firewall rules affecting the traffic. The issue appears isolated to CSP enforcement in newer versions.
@guenhter commented on GitHub (Jul 21, 2025):
Interesting. I tested
WEBUI_AUTH_TRUSTED_EMAIL_HEADERlast week with the latest dev and it worked like a charm. The log though is not giving much information here...On what request are you getting the 500 in the browser?
@drejom commented on GitHub (Jul 21, 2025):
Strangely I'm able to authenticate and login, but immediately get the 500 error....
@guenhter commented on GitHub (Jul 21, 2025):
On what request are you getting the 500 in the browser?
@drejom commented on GitHub (Jul 21, 2025):
So seems it was because of an overly strict CONTENT_SECURITY_POLICY setting; removed it and all good
@drewbroadbent commented on GitHub (Jul 25, 2025):
I am currently experiencing the exact same issue, except I am not using CloudFlare. What and where is the CONTENT_SECURITY_POLICY that are you referring to?
@oiao commented on GitHub (Jul 30, 2025):
FYI I had the same issue and solved by setting the following env variable
CONTENT_SECURITY_POLICY="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.segment.com https://apis.google.com https://*.googleapis.com blob:; worker-src 'self' blob:; child-src 'self' blob:"@bKNNNNN commented on GitHub (Feb 3, 2026):
Solution for Cloudflare Access + Trusted Header Auth (v0.7.2)
"You do not have permission to access this
resource" with
WEBUI_AUTH_TRUSTED_EMAIL_HEADER=Cf-Access-Authenticated-User-Email.Root cause:
ENABLE_SIGNUP=falseblocks trusted header auth!When a new user authenticates via trusted header, OpenWebUI calls
signup()internally to create the account. IfENABLE_SIGNUP=false,this fails with
ACCESS_PROHIBITED.Working config: