ldap3 icon indicating copy to clipboard operation
ldap3 copied to clipboard

`escape_rdn` crashes on empty input

Open sersorrel opened this issue 1 year ago • 1 comments

It feels like this should not happen:

>>> ldap3.utils.dn.escape_rdn("")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/.../venv/lib/python3.10/site-packages/ldap3/utils/dn.py", line 399, in escape_rdn
    if rdn[0] == '#' or rdn[0] == ' ':
IndexError: string index out of range

(given e.g. escape_filter_chars("") just produces an empty string)

sersorrel avatar Apr 19 '23 09:04 sersorrel

escape_rdn isn't even documented 😱

I'm assuming it mitigates injection vulns?

strazto avatar Mar 06 '24 00:03 strazto