Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
LDAP is the protocol applications use to read and search a directory of users, groups, and devices. In most organisations that directory is Active Directory.

What Is LDAP?
LDAP is how applications talk to a directory. The Lightweight Directory Access Protocol, currently specified by RFC 4511, defines operations for searching, reading, adding, modifying, and deleting entries in a hierarchical store of information about people, groups, computers, and printers. When a VPN appliance checks whether someone is in the right group, or an intranet application looks up a job title, it is almost certainly speaking LDAP to Active Directory.
Entries sit in a tree. Each is identified by a distinguished name built from the path to the root, which in a domain called example.co.uk looks like:
CN=Priya Shah,OU=Finance,OU=Users,DC=example,DC=co,DC=uk
Each entry has attributes defined by an object class in the schema: sAMAccountName, mail, memberOf, userAccountControl, servicePrincipalName. Searches use a prefix-notation filter syntax from RFC 4515, which is worth being able to read because it appears constantly in both administrative scripts and attacker tooling:
(&(objectClass=user)(servicePrincipalName=*)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
That filter asks for enabled accounts with a service principal name, which is the first step of Kerberoasting. The same query is run by administrators auditing service accounts and by attackers choosing targets; the protocol cannot tell them apart.
Before a client can search, it binds—LDAP’s word for authenticating. There are three cases, and the differences matter.
For encryption there are two options and they are not the same thing. LDAPS uses TLS from the start on port 636. StartTLS negotiates TLS on the standard port after the connection opens. Both are acceptable; what is not acceptable is a simple bind on port 389 with no protection, and an estate audit will normally find several of them.
Unsigned LDAP connections can be relayed. An attacker who coerces authentication from a machine—through a number of well-known triggers—relays it to a domain controller over LDAP and acts with that machine’s privileges, which in the case of a domain controller is everything.
Microsoft’s advisory ADV190023, issued in August 2019, set out the fix: require LDAP signing and enable LDAP channel binding, so that an authentication cannot be lifted from one channel and replayed on another. The change was originally scheduled to be enforced by default in January 2020, then deferred after widespread concern about legacy clients. Many organisations still have it switched off, and it remains one of the higher-value hardening steps available in a Windows estate. Audit first using the domain controller events that record unsigned and unbound connections, fix the clients that appear, then enforce.
The most consequential thing about LDAP in a domain is that any authenticated user can read a great deal of it. Group membership, descriptions, service principal names, account flags, delegation settings, and access control entries are all queryable by an ordinary account. That is by design—applications need it—and it is also why tools such as BloodHound can map the entire privilege graph of a domain from a single low-privileged session.
You cannot switch that off without breaking the directory’s purpose, so the response is different in kind. Stop putting secrets in attributes people can read, and the description field of service accounts is the standing offender: passwords written there in 2016 are still being found in assessments today. Remove delegation and permission anomalies so that what an attacker enumerates is a short, boring graph. And monitor for the shape of enumeration rather than the fact of it—a single account issuing thousands of directory queries in a few minutes, or querying object classes it has no business reading, is a detectable pattern that precedes most domain compromise.
Finally, treat LDAP as an injection surface in applications. Building a filter by concatenating user input allows filter manipulation in much the same way SQL injection works, as covered in LDAP injection. Parameterise or escape input according to RFC 4515, and give the application’s bind account read-only access to the narrowest subtree it needs.
At Privia Security, we assess directory exposure and relay paths through our infrastructure security testing services.
LDAP is a protocol; Active Directory is a directory service that speaks it. Active Directory also provides Kerberos authentication, Group Policy, DNS integration, and replication, none of which are part of LDAP. Other directories such as OpenLDAP, 389 Directory Server, and various appliance directories also implement the protocol, which is why applications can often target several of them.
Either is acceptable, and the choice usually comes down to what the client supports. LDAPS establishes TLS immediately on port 636, which is simpler to verify from a network perspective. StartTLS upgrades a connection on port 389, which keeps a single port but means an unprotected connection exists briefly. What matters most is that neither leaves credentials on a plain simple bind.
It ties the authentication exchange to the specific TLS channel it was performed over, so an attacker cannot capture an authentication and relay it to the directory on a different connection. Together with LDAP signing it closes a widely exploited relay path. Microsoft set out the configuration in advisory ADV190023; audit for unsigned and unbound connections before enforcing it.
They can read far more of it than most people expect: group membership, account flags, descriptions, service principal names, delegation settings, and permissions are all visible to any authenticated account. That is how privilege mapping tools work from a low-privileged session. The response is to keep secrets out of readable attributes, remove permission anomalies, and monitor for bulk query patterns.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.