Anonymous LDAP Access to Directory Data

Domain controllers answer LDAP searches from unauthenticated connections, letting anyone on the network list users, groups, computers and other directory data.

SeverityMedium
CVSS 3.15.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N Open in the calculator
CVSS 4.06.9 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-306: Missing Authentication for Critical Function
OWASP Top 10A07:2025 Authentication Failures
MITRE ATT&CKT1087.002 Domain Account, T1069.002 Domain Groups
CategoryBroken Access Control

Description

LDAP clients can bind to a directory without credentials. Active Directory always accepts such anonymous binds and lets them read the rootDSE, the entry that describes the server, its naming contexts and functional levels, which is by design. Since Windows Server 2003, anonymous connections cannot search the rest of the directory unless the seventh character of the forest-wide dSHeuristics attribute (on CN=Directory Service,CN=Windows NT,CN=Services in the configuration partition) is set to 2 and the ANONYMOUS LOGON identity is granted read access to the objects concerned. Administrators sometimes make these changes for legacy applications, printers and scanners, or Unix and Linux systems that look up users without credentials.

Where they have been made, anyone who can reach a domain controller can read the directory without an account, and a simple bind with a user name but an empty password is treated as anonymous and gets the same access. Depending on the permissions granted, this typically includes user names, group memberships, computer names and attributes such as descriptions, which sometimes contain passwords. An attacker can use it to build lists of valid accounts for password spraying, to identify administrators, service accounts and servers, and to plan further attacks before holding any credentials. The impact is limited to disclosure, and its extent depends on what ANONYMOUS LOGON can read; secret attributes such as password hashes are not exposed.

The finding is confirmed when an unauthenticated search returns directory objects, for example with ldapsearch using a simple bind without credentials, or NetExec's LDAP module with an empty user name and password. Results that show only the rootDSE do not indicate this finding, although some scanners report any successful anonymous bind as an issue.

Remediation

  • Set the seventh character of dSHeuristics back to 0, leaving any other characters unchanged, or clear the attribute if no other character is in use, using ADSI Edit on CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration in the forest root domain. The change applies to every domain controller in the forest.
  • Remove access control entries that grant ANONYMOUS LOGON read access to directory objects, and remove ANONYMOUS LOGON and Everyone from groups that grant read access, such as Pre-Windows 2000 Compatible Access.
  • Before the change, identify the systems that rely on anonymous access, from the application owners or from network traffic, and give each a dedicated low-privileged account that binds with credentials, preferably over LDAPS or with signing.

Confirm the fix by repeating the anonymous search, which should now fail with an error stating that a successful bind must be completed on the connection before the operation can be performed.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Active Directory Findings

Every Active Directory finding