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
LIKEmatching 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
LIKEor 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.

