mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #20701] Issue: Group Sharing Permissions Bug and OAuth Group Duplication #19267
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 @antpar-rf on GitHub (Jan 15, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20701
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
0.7.2
Ollama Version (if applicable)
No response
Operating System
Ubuntu
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Commit ca514cd3 introduced critical bugs in group sharing permissions that cause:
{"config": {"share": "members"}}to be invisible to their own membersAffected Versions
When new groups are created they are defaulted presently to enable sharing for "Anyone" which could be a security issue
Proposal for new feature:
Add environment variable configuration:
for when new groups are created through SSO or SCIM rather than defaulting to an access of "Anyone"
Actual Behavior
Bug #1: Groups with
share: "members"Invisible to MembersLocation:
backend/open_webui/models/groups.py-GroupTable.get_groups()methodThe Problem:
In the
aftercode (commitca514cd3), the filtering logic was changed from:To:
Bug #2: OAuth/Okta Group Duplication
Location: OAuth group synchronization code path (likely in
backend/open_webui/routers/auths.pyor group creation logic)The Problem:
When upgrading from 0.6.4 to 0.7.2, the modified
get_groups()filtering logic affects how OAuth/Okta group synchronization finds existing groups. If the group lookup query is filtered withshare=Truebut doesn't passmember_id, groups with{"config": {"share": "members"}}won't be found, causing the system to treat them as non-existent and create duplicates.Steps to Reproduce
Bug #1: Groups with
share: "members"Invisible to MembersMissing
member_idin filter dict: If the calling code doesn't passfilter.get("member_id"), groups with{"config": {"share": "members"}}are excluded entirely - even for actual members!Type confusion: The code uses both
json_share_bool == Trueandjson_share_str == "members", but the new string value"members"isn't handled in theanyone_can_sharecondition. When interpreted as a boolean, the string"members"won't equalTrue.Legacy data handling: Existing groups with:
data = null→ Works (matchesGroup.data.is_(None))data = {}→ Broken (doesn't match any condition)data = {"config": {"share": false}}→ Works (matchesjson_share_bool == Falsein the else branch)data = {"config": {"share": "members"}}→ Broken (requiresmember_idin filter)Bug #2: OAuth/Okta Group Duplication
Sequence of events:
get_groups()with a filterLogs & Screenshots
🧪 Testing Plan
Test Case 1: Member-Only Group Visibility
{"config": {"share": "members"}}Test Case 2: Legacy Group Migration
data = nulldata = {}data = {"config": {"share": false}}data = {"config": {"share": true}}Test Case 3: OAuth Group No Duplication
Additional Information
🔧 Proposed Fixes
Fix #1: Correct the Share Filtering Logic
File:
backend/open_webui/models/groups.pyChanges needed in
get_groups()method:Fix #2: Ensure
member_idis Always Passed When NeededFiles to check and update:
Groups.get_groups()for user-specific contextsbackend/open_webui/routers/groups.py, UI components insrc/Example fix (in relevant API endpoints):
Fix #3: OAuth Group Lookup Should Not Use Share Filtering
File:
backend/open_webui/routers/auths.py(or wherever OAuth group sync happens)Problem: When looking up existing groups during OAuth sync, the query should NOT apply share permission filters.
Fix:
Fix #4: Example of Database Migration for Legacy Groups / Normalize sharing options
New migration file:
backend/open_webui/migrations/versions/XXXX_normalize_group_share_config.pyFix #5: Default Share Config for New Groups
File:
backend/open_webui/models/groups.py-insert_new_group()methodCurrent:
Proposed Fix (add default share config):
Alternative: Add environment variable configuration:
Fix #6: OAuth Group Creation Default Config
File: Wherever OAuth groups are created (likely
create_groups_by_group_names()ingroups.py)Current (from source):
Fix:
@owui-terminator[bot] commented on GitHub (Jan 15, 2026):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#20666 issue: knowledge sharing in groups member broken
by janl772 • Jan 14, 2026 •
bug#19588 issue: Model group permissions
by apunkt • Nov 29, 2025 •
bug#19426 issue: Strange Behavior With Groups
by matthew-kusz • Nov 24, 2025 •
bug#19475 issue: A users groups aren't always updated on OAuh login
by tobiasge • Nov 25, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@michal-zima-cnb commented on GitHub (Jan 21, 2026):
It looks that Bug #1: Groups with share: "members" Invisible to Members within this issue is similar to #19468 , which has been fixed in v 0.6.41, but it is appearing again in current release v 0.7.2
@michal-zima-cnb commented on GitHub (Feb 16, 2026):
Is there any update/work in progress for issue Bug #1: Groups with share: "members" Invisible to Members ? I have not seen any update for releases higher than 0.7.2. Thanks for response
@Classic298 commented on GitHub (Feb 16, 2026):
How can i reproduce this? If I have a group set to "members", it ... just works.
All members can see the group and share to it too.
@michal-zima-cnb commented on GitHub (Feb 16, 2026):
I just downloaded and tested image with latest release (v 0.8.2) and it seems, that issue has been fixed here - group sharing (write access) for models works fine. But release detail ( does not mention it.
@Classic298 commented on GitHub (Feb 16, 2026):
I have never seen this issue to begin with, but alright - thanks for confirming it is fixed!
@michal-zima-cnb commented on GitHub (Feb 16, 2026):
This issue has been present in 0.7.2 - definitely....
@antpar-rf commented on GitHub (Feb 19, 2026):
@Classic298 @michal-zima-cnb - when a migration occurs to 0.6.x -> 0.8.3 it still changes group permissions from what use to be "members only" to anyone can access said group, which is an issue; someone has to manually update all the records in the database -- which we did.
Additionally -- there is no environmental variable that enables new groups via oauth to persist as members only which was the behavior back in 0.6 when new groups are created via oAuth, for example as the logic listed above was different in the original Issue created.
The other bugs look to be resolved.
@antpar-rf commented on GitHub (Feb 19, 2026):
b8112d72b9/backend/open_webui/utils/oauth.py (L36)adding a new environment variable like ENABLE_OAUTH_GROUP_DEFAULT_SHARING would be helpful to setting defaults of oauth group sharing permissionsIf case 'members' ENABLE_OAUTH_GROUP_DEFAULT_SHARING=members
b8112d72b9/backend/open_webui/utils/oauth.py (L1245)would solve the permissions issues with new groups being created by oAuth being defaulted to anyone in regards to group sharing. Ideally the default behavior should be No One if not set.
@tjbck
A migration script logic should exist mentioned above for the group data permissions payload in groups being changed, but in our case we manually changed them all to solve the issue.
@Classic298 commented on GitHub (Feb 19, 2026):
@antpar-rf this behaviour was documented in the changelog
@antpar-rf commented on GitHub (Feb 19, 2026):
I could create a PR for said change for Group Sharing default behavior when created via Oauth as a feature; otherwise, anyway we could have that added as an environment variable to differentiate no one, members or anyone. @Classic298
@antpar-rf commented on GitHub (Feb 21, 2026):
PR Created related to issue: https://github.com/open-webui/open-webui/pull/21679 @Classic298 @tjbck