All Apps and Add-ons

BUG: UTF-8 reencoding inside sa-ldapsearch ldapfilter

matejkaj
Engager

Hello,
I'd like to report a bug in following plugin:
Splunk Supporting Add-on for Active Directory
If you run a search that yield non-ascii fields and you pass them as parameters into ldapfilter, the search fails with an error.
Example:

| ldapsearch search="(cn=Ůïkëllok Řúxľif)" attrs="distinguishedName"| ldapfilter search="(distinguishedName=$distinguishedName$)" attrs="cn"

The subsequent ldapfilter crashes with following trace:

  File "/opt/splunk/etc/apps/SA-ldapsearch/bin/ldapfilter.py", line 117, in stream
    for entry in entry_generator:
  File "/opt/splunk/etc/apps/SA-ldapsearch/bin/packages/ldap3/extend/standard/PagedSearch.py", line 57, in paged_search_generator
    None if cookie is True else cookie)
  File "/opt/splunk/etc/apps/SA-ldapsearch/bin/packages/ldap3/core/connection.py", line 398, in search
    request = search_operation(search_base, search_filter, search_scope, dereference_aliases, attributes, size_limit, time_limit, types_only, self.server.schema if self.server and self.check_names else None)
  File "/opt/splunk/etc/apps/SA-ldapsearch/bin/packages/ldap3/operation/search.py", line 356, in search_operation
    request['filter'] = build_filter(search_filter, schema)  # parse the searchFilter string and compile it starting from the root node
  File "/opt/splunk/etc/apps/SA-ldapsearch/bin/packages/ldap3/operation/search.py", line 307, in build_filter
    return compile_filter(parse_filter(search_filter, schema).elements[0])
  File "/opt/splunk/etc/apps/SA-ldapsearch/bin/packages/ldap3/operation/search.py", line 215, in parse_filter
    current_node.append(evaluate_match(search_filter[start_pos:end_pos], schema))
  File "/opt/splunk/etc/apps/SA-ldapsearch/bin/packages/ldap3/operation/search.py", line 175, in evaluate_match
    assertion = {'attr': left_part, 'value': validate_assertion_value(schema, left_part, right_part)}
  File "/opt/splunk/etc/apps/SA-ldapsearch/bin/packages/ldap3/protocol/convert.py", line 164, in validate_assertion_value
    validated_value += value[pos].encode('utf-8', errors='ignore')
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc4 in position 0: unexpected end of data

Possible workaround: simply remove ".encode('utf-8', errors='ignore')"

Please fix this issue.
Thanks!

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...

Upgrade Prep for 10.4, Network Observability Deep Dives, and More from Splunk Lantern

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Splunk Developer Day announcements: AI agents, MCP tools, Forecasting, and Custom ...

Splunk Developer Day was packed with product and platform updates for developers building in the AI ...