Closed flippipe closed 2 months ago
Can we expect a PR?
I do not know how node works to be comfortable to know if this is the right way to do it. I hope someone with more expertise do it the right way.
It looks okay to me. I've merged this change and released a new version. Thanks for the report.
Describe the bug
When a user authentication fails in LDAP server, TCP connection is not closed, leading to resource exhaustion on LDAP server.
Expected behavior
After the return of response of InvalidCredentials, the connection should be disconnected.
As it occurs when the authentication is successful
Steps To Reproduce
Do hundreds of invalid authentications
System Info
Additional information
I've fixed this issue in my environment placing an unbind before function return.
But the same logic error, is still present in latest version
https://github.com/haraka/haraka-plugin-ldap/blob/1aecf4b167fa016e59b41cb5f7ea59aba85ec874/authn.js#L18:L26
From ldapjs documentation