Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

escape_rdn crashes on empty input #1086

Open
sersorrel opened this issue Apr 19, 2023 · 1 comment
Open

escape_rdn crashes on empty input #1086

sersorrel opened this issue Apr 19, 2023 · 1 comment

Comments

@sersorrel
Copy link

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)

@strazto
Copy link

strazto commented Mar 6, 2024

escape_rdn isn't even documented 😱

I'm assuming it mitigates injection vulns?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants