/

CVE-2026-87016

Severity:

HIGH RISK

(8.1)

OAuth Identity Confusion (CWE-155) in Open WebUI SQLite

CVE-2026-87016

Analyzed

Vulnerability type

Category:

Authentication Bypass and Identity Confusion

CWE:

CWE-155, CWE-287

Impact:

Account Takeover

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Open WebUI can incorrectly match OAuth or SCIM identities when SQLite processes wildcard characters in an external identifier. An attacker who can control an OAuth subject containing percent or underscore characters may be mapped to another stored identity, potentially receiving an administrator's session.

Affected context

The issue occurs in Open WebUI deployments using SQLite and affected versions of the user lookup functions get_user_by_oauth_sub and get_user_by_scim_external_id. These functions compiled JSON contains matching into SQL LIKE substring comparisons, allowing percent and underscore characters in an OAuth subject or SCIM external ID to act as wildcards. PostgreSQL deployments are not affected according to the vulnerability description.

Exploit preconditions

  • Attack surface: OAuth or SCIM-based identity mapping during user lookup
  • Required access: The ability to authenticate through an identity provider or otherwise influence the external subject value
  • Trigger point: Lookup of an OAuth subject or SCIM external ID in an SQLite-backed deployment
  • Why exploitation is possible: Wildcard characters are interpreted by SQL LIKE matching rather than compared as literal identity data, which may resolve the request to a different stored account

Why this happens

The underlying bug is an authentication identity-matching failure. User-controlled external identifiers were used in a JSON containment lookup that became substring-based SQL LIKE matching on SQLite, without adequately treating wildcard characters as literal data. This behavior maps primarily to CWE-155: Improper Neutralization of Wildcards or Matching Symbols and can contribute to CWE-287: Improper Authentication when the incorrect identity is accepted as authenticated.

Potential impact

  • An attacker may receive a session associated with another user
  • An attacker could gain administrator-level access if an administrator account is selected
  • Account data and application configuration could be exposed or modified
  • Administrative privileges could be used to alter AI platform settings or connected resources

General mitigation guidance

Mitigation generally focuses on making identity comparisons exact, literal, and independent of database-specific wildcard behavior.

Common defensive patterns include:

  • Use parameterized equality comparisons or database-native JSON operators that preserve exact identifier semantics
  • Escape wildcard characters whenever pattern matching is unavoidable
  • Normalize and validate OAuth subjects and SCIM external IDs before lookup
  • Bind authenticated identities to immutable provider, tenant, and subject values
  • Apply least privilege to administrator roles and connected service accounts
  • Add regression tests covering percent, underscore, and other pattern-significant characters

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying user-controlled identity values passed to LIKE or wildcard-enabled queries
  • Code review checks for exact identity comparisons that vary by database backend
  • Tests that compare literal identifiers containing percent and underscore characters
  • Authentication telemetry showing unusual subject values, unexpected account mappings, or administrative sessions issued to new identities
  • Policy enforcement requiring provider, tenant, and subject fields to be matched as an immutable tuple

Automated security review tools may help identify unsafe wildcard handling, but database-specific behavior should also be validated with integration tests.

Sources

SourceLink
github.comgithub.com/open-webui/open-webui/commit/73c1f5806aeb6345dad5de8f5aa26d1f3d0bef80
github.comgithub.com/open-webui/open-webui/pull/28624
github.comgithub.com/open-webui/open-webui/releases/tag/v0.11.1
github.comgithub.com/open-webui/open-webui/security/advisories/GHSA-wpmr-8h3q-fwj7

Frequently asked

questions

It may be exploitable through an exposed OAuth or SCIM authentication flow when the deployment uses SQLite and the attacker can influence the external identity subject.

The attacker generally needs to authenticate through a configured identity provider or otherwise supply an external identifier that reaches the affected user lookup functions. Direct database access is not necessarily required.

Use exact, parameterized identity comparisons that treat percent and underscore as ordinary characters, and avoid relying on database-specific LIKE behavior for authentication decisions.

Test identity mapping across supported database engines, validate provider and subject values as immutable identity attributes, monitor unexpected account associations, and apply least privilege to authenticated roles.

Find out what's already
exploitable in your codebase.