highCVSS 8.1Vulnerability

CVE-2026-45675

## Summary The LDAP and OAuth authentication flows use a TOCTOU (Time-of-Check-Time-of-Use) pattern for first-user admin role assignment. The regular signup handler (`signup_handler` in auths.py, line 663) was explicitly patched to prevent this race with the comment *"Insert with default role first to avoid TOCTOU race"*, but the LDAP and OAuth code paths were never updated with the same fix. ## Vulnerable Code ### LDAP (auths.py, lines 479-490) ```python # Line 482 - CHECK: is the user table empty? role = 'admin' if not Users.has_users(db=db) else request.app.state.config.DEFAULT_USER_ROLE # Lines 484-490 - USE: create user with the role determined above user = Auths.insert_new_auth( email=email, password=str(uuid.uuid4()), name=cn, role=role, # <-- role was determined BEFORE insert, race window exists db=db, ) ``` ### OAuth (oauth.py, lines 1103-1112, 1566-1574) ```python # Line 1104 - CHECK: count users def get_user_role(self, user, user_data): user_count = Users.get_num_users() if not user and user_count == 0: return 'admin' # Line 1112 # Lines 1566-1574 - USE: create user with pre-determined role user = Auths.insert_new_auth( ... role=self.get_user_role(None, user_data), # Line 1571 ... ) ``` Both paths determine the role BEFORE inserting the user, creating a race window where multiple concurrent requests on a fresh instance can all observe an empty database and all receive the `admin` role. ## Comparison with Patched Signup The `signup_handler` (auths.py, line 663) was explicitly fixed: ```python # Insert with default role first to avoid TOCTOU race user = Auths.insert_new_auth(..., role=DEFAULT_USER_ROLE, ...) # Then check if this is the only user and upgrade if Users.get_num_users() == 1: Users.update_user_role_by_id(user.id, 'admin') ``` The LDAP and OAuth paths did NOT receive this fix. ## Exploitation 1. Deploy Open WebUI with LDAP or OAuth enabled on a fresh instance (no existing users

Properties

summary
Open WebUI: LDAP and OAuth First-User Race Condition Allows Multiple Admin Accounts
severity
high
epss_score
0.00354
cvss_score
8.1
ghsa_published
2026-05-14T20:28:46Z
source_url
https://github.com/advisories/GHSA-h3ww-q6xx-w7x3
ghsa_updated
2026-05-15T23:55:05Z
ghsa_id
GHSA-h3ww-q6xx-w7x3
cve_id
CVE-2026-45675
cvss_vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
is_ghsa_only
false
epss_percentile
0.28299

Related Entities (6)

ENRICHED_BY (1)

[Source]FIRST EPSS

HAS_WEAKNESS (2)

[Weakness]Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
[Weakness]Improper Privilege Management

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]pip/open-webui

AFFECTS (1)

[Software]pip/open-webui

Explore deeper with Ninja Signal's threat intelligence graph