listLdapGroupMemberships() Failed group searchldap: invalid characters for escape in filter #9158

Closed
opened 2025-11-02 08:31:00 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @rmie on GitHub (Jul 1, 2022).

Description

Our LDAP group memberships are based on DN of users, and one of the fields contains a comma separated value.

e. .g. members:
CN=givenName\, sn,OU=,DC=,DC=****
...

Mapping Organization Teams to LDAP groups doesn't work in this case and we find log messages like:
2022/06/28 07:08:51 ...dap/source_search.go:215:listLdapGroupMemberships() [E] [62baa8f9-2] Failed group search using filter[(member=CN=givenName\, sn,OU=,DC=,DC=***)]: LDAP Result Code 201 "Filter Compile Error": ldap: invalid characters for escape in filter: encoding/hex: invalid byte: U+002C ','

The issue seems to similar to: https://github.com/go-gitea/gitea/issues/9169#issuecomment-558738712
but the proposed solution, using "\5c," instead of "," can't be applied in this situation.

Gitea Version

1.17.0+rc1 built with GNU Make 4.3, go1.18.3 : bindata, timetzdata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

2022/06/28 07:08:51 ...dap/source_search.go:215:listLdapGroupMemberships() [E] [62baa8f9-2] Failed group search using filter[(member=CN=givenName\, sn,OU=,DC=,DC=***)]: LDAP Result Code 201 "Filter Compile Error": ldap: invalid characters for escape in filter: encoding/hex: invalid byte: U+002C ','

Screenshots

No response

Git Version

n/a

Operating System

docker on linux

How are you running Gitea?

from dockerhub: gitea/gitea:1.17.0-rc1 (0ebbe9daf27d)

Database

SQLite

Originally created by @rmie on GitHub (Jul 1, 2022). ### Description Our LDAP group memberships are based on DN of users, and one of the fields contains a comma separated value. e. .g. members: CN=givenName\\, sn,OU=****,DC=****,DC=**** ... Mapping Organization Teams to LDAP groups doesn't work in this case and we find log messages like: 2022/06/28 07:08:51 ...dap/source_search.go:215:listLdapGroupMemberships() [E] [62baa8f9-2] Failed group search using filter[(member=CN=givenName\\, sn,OU=***,DC=***,DC=***)]: LDAP Result Code 201 "Filter Compile Error": ldap: invalid characters for escape in filter: encoding/hex: invalid byte: U+002C ',' The issue seems to similar to: https://github.com/go-gitea/gitea/issues/9169#issuecomment-558738712 but the proposed solution, using "\5c," instead of "\," can't be applied in this situation. ### Gitea Version 1.17.0+rc1 built with GNU Make 4.3, go1.18.3 : bindata, timetzdata, sqlite, sqlite_unlock_notify ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist 2022/06/28 07:08:51 ...dap/source_search.go:215:listLdapGroupMemberships() [E] [62baa8f9-2] Failed group search using filter[(member=CN=givenName\\, sn,OU=***,DC=***,DC=***)]: LDAP Result Code 201 "Filter Compile Error": ldap: invalid characters for escape in filter: encoding/hex: invalid byte: U+002C ',' ### Screenshots _No response_ ### Git Version n/a ### Operating System docker on linux ### How are you running Gitea? from dockerhub: gitea/gitea:1.17.0-rc1 (0ebbe9daf27d) ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 08:31:00 -06:00
Author
Owner

@gd197 commented on GitHub (Jul 1, 2022):

Same as well for us #20181
I wonder whether issue #20120 could be also related

@gd197 commented on GitHub (Jul 1, 2022): Same as well for us #20181 I wonder whether issue #20120 could be also related
Author
Owner

@rmie commented on GitHub (Jul 1, 2022):

I agree, https://github.com/go-gitea/gitea/issues/20181 sounds like the same issue.

Sorry for opening a duplicate.

@rmie commented on GitHub (Jul 1, 2022): I agree, https://github.com/go-gitea/gitea/issues/20181 sounds like the same issue. Sorry for opening a duplicate.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9158