Episode 6: How I Discovered LDAP Injection and Why It Matters (Ev
A login form built an LDAP filter by directly inserting the username and password, so special characters in the password changed the query's meaning. The author logged in as an administrator without knowing the real password.
Published on infosecwriteups.com
Hello everyone, hope you’re doing awesome! 🌟 Welcome back to my Medium series, The Injection Chronicles.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application built the LDAP filter by directly concatenating user input without validation or escaping.
Impact
An attacker could bypass authentication and log in as any user, including an administrator, without knowing the password.
What the attacker needed
Access to the login form; no valid credentials needed
The fix
The application should validate input against an allow-list, escape LDAP metacharacters, and use parameterised LDAP queries instead of string concatenation.
How it was found
- Open the login page and enter a username.
- Enter a password containing LDAP special characters that close the password condition and add an OR condition matching any password.
- Submit the form and observe that the login succeeds as the chosen user without the correct password.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
LDAP is a directory service, like a company phonebook that stores user accounts. The login page put whatever you typed straight into a search query, so typing special characters could change what the search asked for. That let the author log in as an admin without the real password.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.