Skip to content

[AUTH] Escape LDAP special characters in filter and DN values - #7761

Open
aajisaka wants to merge 1 commit into
apache:masterfrom
aajisaka:ldap-authn-filter-escaping
Open

aajisaka wants to merge 1 commit into
apache:masterfrom
aajisaka:ldap-authn-filter-escaping

Conversation

@aajisaka

Copy link
Copy Markdown
Member

Why are the changes needed?

Usernames are substituted into LDAP search filters and into user DN patterns when building candidate bind DNs, and group DNs resolved from the directory are substituted into the membership filter. Escape those values per RFC 4515 and RFC 4514 so the directory reads them literally, substitute placeholders literally so that $ and \ in a username are taken as-is, and accept distinguished names that carry no comma.

How was this patch tested?

Added new regression tests.

Was this patch assisted by generative AI tooling?

Assisted-by: OpenCode (GLM-5.3-Flash, MiMo-V2.6-Pro)

Usernames are substituted into LDAP search filters and into user DN
patterns when building candidate bind DNs, and group DNs resolved from
the directory are substituted into the membership filter. Escape those
values per RFC 4515 and RFC 4514 so the directory reads them literally,
substitute placeholders literally so that '$' and '\' in a username are
taken as-is, and accept distinguished names that carry no comma.
@aajisaka aajisaka self-assigned this Sep 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant