$7,500 for a Wildcard in the Wrong Place: LDAP Injection to Authentication Bypass
The login form built an LDAP search filter by concatenating user input without escaping special characters, so an attacker could inject parentheses and wildcards to restructure the filter. This allowed authentication as any known or guessable username without a valid password.
I almost skipped this login form entirely. It looked like every other enterprise single-sign-on page I’ve tested — username, password, a “forgot password” link, nothing visually distinctive.
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 LDAP filters by string concatenation without escaping special characters, allowing injection of filter syntax.
Impact
Complete authentication bypass for any known or guessable username, requiring no valid password and no prior access, with the technique demonstrated to generalise to specific targeted accounts.
What the attacker needed
A known or guessable username; no valid password needed
The fix
The login endpoint was fixed by migrating to parameterised LDAP filter construction using the directory library's built-in escaping functions.
How it was found
- Enter a username containing a parenthesis and observe a different, verbose error message.
- Inject a closing parenthesis and a logical clause to restructure the filter and test for bypass.
- Adjust parenthesis counts and operators while watching error behaviour to map the filter structure.
- Use a wildcard-based OR clause to authenticate as the first matching directory entry.
- Target a specific known username with a similar injection to confirm the bypass generalises.
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 used by companies to store user accounts. The login page inserted what you typed directly into a database query without cleaning it, so special characters like parentheses could change the query's logic. An attacker could then log in as any user without knowing their password.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.