mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-03 07:24:59 -05:00
[PR #20160] [CLOSED] fix: enable placeholder substitution in LDAP search filters #112796
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20160
Author: @polaz
Created: 12/24/2025
Status: ❌ Closed
Base:
dev← Head:fix/ldap-search-filter-placeholder-v2📝 Commits (1)
cd8e2c2fix(ldap): enable placeholder substitution in LDAP search filters📊 Changes
1 file changed (+13 additions, -1 deletions)
View changed files
📝
backend/open_webui/routers/auths.py(+13 -1)📄 Description
Pull Request Checklist
devbranch.fix:prefix.Changelog Entry
Description
This PR fixes the LDAP search filter placeholder substitution issue discussed in https://github.com/open-webui/open-webui/discussions/16760
Previously, if a user configured the LDAP search filter to use placeholders like
(uid=%s), these placeholders were never substituted with the actual username. The filter was concatenated as-is, resulting in malformed LDAP queries and "User not found" errors.Added
Changed
Deprecated
Removed
Fixed
%sand%(user)splaceholders with the escaped username(uid=%s)- simple user lookup(&(objectClass=person)(memberOf=cn=allowed-users,ou=groups,dc=example,dc=com)(uid=%s))- lookup with group membership restrictionSecurity
escape_filter_chars()before substitution to prevent LDAP injection attacksBreaking Changes
Additional Information
Screenshots or Videos
N/A - Backend fix only
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.