Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify fresh Open WebUI deployment
-
ExploitAuthenticate via LDAP/OAuth concurrently with other users
-
ExecutionRace condition grants all concurrent users admin role
-
ImpactExploit admin privileges to access API keys and user data
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V8 - Authorization Least privilege enforcement
MITRE ATT&CK
1 technique across 1 tactic: Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Fresh Open WebUI deployment with LDAP authentication enabled (LDAP_URI and related environment variables configured) OR OAuth authentication enabled (OAUTH_PROVIDERS configured with at least one provider such as Google, Microsoft, GitHub). The instance must have zero existing user accounts in the database - exploitation is impossible if any user (admin or non-admin) already exists. DATABASE_ENABLE_SESSION_SHARING must be False (the default per env.py:387), which ensures each authentication request uses an isolated database session, widening the race window. Attacker must be able to authenticate via the configured LDAP server or OAuth provider (requires valid corporate credentials or OAuth tokens, not anonymous access). Multiple concurrent authentication requests must arrive within the race window, typically hundreds of milliseconds to a few seconds depending on database performance and network latency. Non-default configurations that LIMIT exploitation: DATABASE_ENABLE_SESSION_SHARING=True narrows the race window by sharing transaction context. Deployments using only the standard signup handler (no LDAP/OAuth) are not affected by this specific vulnerability. Single-user or staggered onboarding processes that create the first admin account before enabling LDAP/OAuth effectively close the window. |
| Impact | Real-world risk is constrained by narrow exploitation window but severe in impact when conditions align. CVSS 8.1 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H) accurately reflects this trade-off: network-accessible unauthenticated attack but high complexity due to precise timing requirements. The AC:H (high attack complexity) rating is justified - exploitation requires concurrent requests during the brief first-deployment phase before any legitimate admin account exists, a window measured in seconds to minutes for typical deployments. No EPSS score or CISA KEV status indicates this has not been observed in widespread automated exploitation campaigns. However, GitHub advisory explicitly confirms public exploit code exists (POC=YES), lowering the skill barrier. SSVC framework assessment: Exploitation=POC (proof-of-concept public), Automatable=No (requires timing precision and deployment-specific knowledge of LDAP/OAuth configuration), Technical Impact=Total (full admin privileges grant access to all user data, API keys, LLM backend configurations, and system settings). Priority depends heavily on deployment context: organizations performing fresh Open WebUI rollouts with LDAP/OAuth in the next 30-90 days face genuine risk; existing deployments with established admin accounts cannot be exploited through this vector. The vulnerability's self-limiting nature (only exploitable on fresh instances) explains the absence of KEV listing despite high CVSS score. |
| Exploit ScenarioDerived | An attacker monitors organizational communications or deployment schedules to identify when a new Open WebUI instance with LDAP or OAuth authentication will be launched. During the initial rollout window (typically first 15-60 minutes after deployment goes live), the attacker and one or more accomplices send precisely timed concurrent authentication requests through the LDAP or OAuth flow - for example, three users authenticate via corporate OAuth within a 500-millisecond window. All three requests execute the has_users() or get_num_users() check simultaneously while the database is still empty, each receiving a 'user count zero' response. All three user creation operations then proceed with role='admin' assignments. The attacker now possesses a persistent administrator account granting full access to all user conversations, API keys for connected LLM backends (OpenAI, Anthropic, local models), system configuration including authentication settings, and the ability to exfiltrate or manipulate data from all other users. GitHub advisory GHSA-h3ww-q6xx-w7x3 confirms public proof-of-concept code exists to demonstrate this timing attack. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 14, 2026
Multiple concurrent LDAP or OAuth first-login requests on a freshly deployed Open WebUI instance can all receive administrator privileges through a TOCTOU race condition in role assignment logic. The vulnerability affects deployments using LDAP or OAuth authentication on instances with no existing users. While the regular signup handler was explicitly patched for this race condition in earlier code ('Insert with default role first to avoid TOCTOU race'), the LDAP and OAuth authentication paths were never updated with the same fix. Vendor-released patch available in version 0.9.0 (April 2026). No active exploitation confirmed (not in CISA KEV), though publicly available exploit code exists per GitHub advisory GHSA-h3ww-q6xx-w7x3. CVSS 8.1 (High) reflects network attack vector but requires high attack complexity (precise timing of concurrent requests during narrow first-deployment window).
RemediationAI
Upgrade to Open WebUI version 0.9.0 or later, released April 2026, which implements the atomic insert-then-check pattern across all authentication paths. The fix (GitHub PR #23626, commit 96a0b3239b1aadb23fc359bf10849c9ba12fd6ec at https://github.com/open-webui/open-webui/commit/96a0b3239b1aadb23fc359bf10849c9ba12fd6ec) modifies both LDAP (routers/auths.py) and OAuth (utils/oauth.py) registration handlers to insert new users with DEFAULT_USER_ROLE unconditionally, then atomically check Users.get_num_users() == 1 after the database commit to determine admin promotion, matching the pattern already used in signup_handler. For organizations unable to upgrade immediately, implement procedural controls: perform initial Open WebUI deployment in an isolated network segment, manually create the first admin account via the standard signup interface before enabling LDAP/OAuth authentication, then verify exactly one admin account exists before exposing the instance to broader user population. This workaround eliminates the race window by ensuring the database is never empty when LDAP/OAuth authentication begins. Note that disabling LDAP/OAuth and using only standard signup is NOT a viable mitigation if these authentication methods are required by organizational SSO policies. The procedural control adds deployment complexity and requires careful sequencing; version upgrade to 0.9.0 is strongly preferred. Advisory and patch details at https://github.com/open-webui/open-webui/security/advisories/GHSA-h3ww-q6xx-w7x3 and release notes at https://github.com/open-webui/open-webui/releases/tag/v0.9.0.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability stems from a classic Time-of-Check-Time-of-Use (TOCTOU) race condition (CWE-269: Improper Privilege Management) in the Open WebUI authentication subsystem, a Python-based web application for LLM interaction. During first-user initialization, the application follows a check-then-act pattern: LDAP code (auths.py:482) calls Users.has_users() to determine if admin role should be assigned, then inserts the user with that predetermined role several lines later (lines 484-490). The OAuth path (oauth.py:1103-1112, 1566-1574) exhibits identical logic via OAuthManager.get_user_role() checking get_num_users() == 0 before user creation. The race window exists between the empty-database check and the actual INSERT operation. DATABASE_ENABLE_SESSION_SHARING defaults to False (env.py:387), meaning each authentication request uses an isolated database session with no shared transaction context, significantly widening the exploitable race window. The affected package pip/open-webui (CPE pkg:pip/open-webui) uses this flawed pattern in two critical authentication flows while the standard signup_handler was previously hardened against the same race.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (https://github.com/open-webui/open-webui) · only source for this CVE.
CVSS VectorVendor: https://github.com/open-webui/open-webui
DescriptionCVE.org
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)
# 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)
# 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:
# 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
- Deploy Open WebUI with LDAP or OAuth enabled on a fresh instance (no existing users)
- Send multiple concurrent authentication requests from different users
- Multiple requests pass the
has_users()/get_num_users() == 0check simultaneously - All concurrent users become administrators
DATABASE_ENABLE_SESSION_SHARING defaults to False (env.py:387), so each call uses its own database session, widening the race window.
Impact
Any LDAP/OAuth user who times their first login concurrently with the legitimate first admin can escalate to full admin privileges, gaining access to all user data, system configuration, API keys, and connected LLM backends.
Suggested Fix
Apply the same insert-then-check pattern used in signup_handler: insert the user with DEFAULT_USER_ROLE first, then atomically check if this is the only user and upgrade to admin only if so.
Resolution
Fixed in PR #23626 (commit 96a0b3239), first released in v0.9.0 (Apr 2026). Both LDAP (routers/auths.py) and OAuth (utils/oauth.py) registration paths now use the same insert-first-check-after pattern that signup_handler already had:
- Insert the new user with
DEFAULT_USER_ROLEunconditionally - no pre-insert role decision based on user count. - After the insert commits, atomically call
Users.get_num_users() == 1to check whether this is the sole user. - Only the sole user gets promoted to
adminviaUsers.update_user_role_by_id.
OAuthManager.get_user_role was also updated to return DEFAULT_USER_ROLE (not admin) for first-user bootstrap; admin promotion is deferred to the post-insert check above. With this ordering, two concurrent first-user registrations that both observe an empty table can both insert, but only one will see get_num_users() 1 afterward - the other will see 2 and not be promoted.
Users on >= 0.9.0 are not affected.
Executive ViewAI
Open WebUI versions prior to 0.9.0 contain a race condition in LDAP and OAuth authentication that allows unauthenticated attackers to gain administrator privileges during initial deployment when no users exist. This affects any organization using Open WebUI with LDAP or OAuth as the authentication backend, particularly in development or newly provisioned environments, potentially leading to complete compromise of the application and any connected data or services.
Apply vendor patch to version 0.9.0 or later. Interim mitigations if patching is delayed: (1) Restrict network access to Open WebUI instances during initial deployment; (2) Temporarily disable LDAP/OAuth authentication and use local-only account creation until patch is applied; (3) Monitor for and immediately revoke any administrator accounts created via LDAP or OAuth during deployment phases; (4) Deploy instances only in air-gapped or strictly controlled environments until patch is available.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
EUVD-2026-30607
GHSA-h3ww-q6xx-w7x3
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB