Skip to content
SQL injection Write-up Beginner

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.

Yamini Yadav_369 Follow

Published on infosecwriteups.com

Hello everyone, hope you’re doing awesome! 🌟 Welcome back to my Medium series, The Injection Chronicles.

Yamini Yadav_369, on infosecwriteups.com

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

  1. Open the login page and enter a username.
  2. Enter a password containing LDAP special characters that close the password condition and add an OR condition matching any password.
  3. 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.

More by Yamini Yadav_369

View all

13 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.