Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.0.1
-
Fix Version/s: 2.1.2
-
Component/s: Authentication & Authorization
-
Labels:None
-
Patch Submitted:Yes
-
Number of attachments :
Description
On many LDAP systems allowing anonymous binding, when a DN binds with a blank password, it will be considered as an anonymous bind and will end up as a successful authentication.
To prevent this, just add a config line :
# (advanced option) Prevent blank password. # Default is false. ldap.preventBlankPwd: true
Which would be used in authenticate() method:
Boolean checkBlankPwd = (ldapContextFactory.getPreventBlankPwd())?((StringUtils.isNotBlank(password))?true:false):true; ... return StringUtils.isNotBlank(principal) && checkBlankPwd && checkPasswordUsingBind(principal, password);
Issue Links
- is related to
-
SONAR-3968
Sonar should not allow any login with a blank password even when this authentication depends on an external system like LDAP
-
Hi,
Your patch increases complexity of code, so I suppose that it can be refactored.
Also could you please describe: why we need new option for such case? Why not just block empty passwords?