Knowledge Base · general

LDAP Injection

generaltechnique notetechniqueldap-injection

Injecting LDAP filter metacharacters into a query to bypass authentication or extract data blind.

How it works

  • Unescaped *, ), (, |, & change the filter’s meaning ((&(user=*)(pass=*)) matches anything).
  • Blind extraction via boolean or timing side channels when the app reveals only success/failure.

Detection & defence

  • Escape LDAP special characters and use parameterised filter builders.
  • Bind with a least-privilege directory account.