Skip to content

LDAP Anonymous Authentication

Description

Without proper access control, executing an LDAP statement that contains a user-controlled value can allow an attacker to abuse poorly configured LDAP context

Examples

Insecure Code

scala
$ENV.put(Context.SECURITY_AUTHENTICATION, "none");

Secure Code

scala
$ENV.put(Context.SECURITY_AUTHENTICATION, "simple"); // with proper credentials

Remediation

Implement proper authentication and access control for LDAP connections, avoiding anonymous authentication

Rule Details

FieldValue
IDCODE-0055
CategoryAuth
SeverityMEDIUM
CWECWE-358
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityMODERATE
Tagsauthentication, access control
OWASPN/A