mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #23959] [CLOSED] fix(iframe-embedding): auto SameSite=None + Secure cookies #43086
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/23959
Author: @pet84
Created: 4/21/2026
Status: ❌ Closed
Base:
main← Head:fix/iframe-embedding-auto-samesite📝 Commits (10+)
87bf44eAdd Railway configuration7e5ca21Fix: Remove startCommand, use Dockerfile CMDd274dd5Add automatic model icons based on model name/IDb44ed56Update application logos and faviconsc7eed79Merge tag 'v0.7.2'499d879Center and enlarge login page logoa703fa9Update Czech translations: ArchEnergy branding and thread reply translation2482ccaUpdate favicon and logo iconsfdf4232Update favicon.svg59bf575Rename 'Modely' to 'Agenty' and 'PracovnĂ prostor' to 'Tvorba AgentĹŻ' in Czech translation📊 Changes
68 files changed (+20484 additions, -114 deletions)
View changed files
📝
.env.example(+13 -1)➕
.github/workflows/railway-nightly-redeploy.yml(+59 -0)📝
.gitignore(+8 -0)📝
CHANGELOG.md(+21 -0)📝
backend/open_webui/config.py(+13 -0)📝
backend/open_webui/env.py(+12 -5)📝
backend/open_webui/main.py(+70 -0)📝
backend/open_webui/migrations/versions/b7c8d9e0f1a2_add_last_read_at_to_chat.py(+15 -4)📝
backend/open_webui/routers/models.py(+56 -0)📝
backend/open_webui/utils/security_headers.py(+96 -1)📝
backend/requirements.txt(+1 -1)➕
docs/cs/FU-JIE_PLUGINS.md(+160 -0)➕
docs/cs/GRAF_PLUGINS_COMPARISON.md(+127 -0)➕
docs/cs/adaptive_memory.md(+90 -0)➕
docs/cs/airis_image_pipeline.md(+217 -0)➕
docs/cs/airis_image_pipeline.py(+186 -0)➕
docs/cs/chartjs.md(+54 -0)➕
docs/cs/deep_dive.md(+884 -0)➕
docs/cs/document_generator.md(+359 -0)➕
docs/cs/export_to_excel.md(+1347 -0)...and 48 more files
📄 Description
Problem
ENABLE_IFRAME_EMBEDDING=true(added in previous commit) correctly removesX-Frame-Optionsand relaxes CSPframe-ancestors, so the browser will render the WebUI inside a cross-origin iframe (e.g. Chrome extension sidepanel atchrome-extension://...framinghttps://chat3.archenergy.cz).But the Svelte app immediately calls
getSessionUser()viafetch(..., { credentials: 'include' }). Auth + session cookies default toSameSite=Lax, which the browser refuses to send inside a third-party iframe. Result: UI loads → session check returns empty → user is stuck on splash/login screen.This is exactly the symptom reported in a Chrome extension integration: „vidím jen ikonku a login, nic víc".
Fix
When
ENABLE_IFRAME_EMBEDDING=true, change the default for:WEBUI_SESSION_COOKIE_SAME_SITE:lax→noneWEBUI_SESSION_COOKIE_SECURE:false→trueExplicit env-var overrides still win. Without the flag, nothing changes.
Requirements
SameSite=Nonecookies withoutSecureare rejected by all modern browsers — standard for any reverse-proxied setup.X-Frame-Optionsor stripSet-Cookieattributes. Configure them separately if needed.Test plan
SameSite=Lax,Secure=false, app loads standalone).ENABLE_IFRAME_EMBEDDING=true→Set-Cookieresponse headers showSameSite=None; Secure.WEBUI_SESSION_COOKIE_SAME_SITE=strictwith flag on → explicit override wins (value isstrict).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.