High Web Application Scanning Plugin ID 98127
DescriptionLightweight Directory Access Protocol (LDAP) is used by web applications to access and maintain directory information services.
One of the most common uses for LDAP is to provide a Single-Sign-On (SSO) service that will allow clients to authenticate with a web site without any interaction (assuming their credentials have been validated by the SSO provider).
LDAP injection occurs when untrusted data is used by the web application to query the LDAP directory without prior sanitisation.
This is a serious security risk, as it could allow cyber-criminals the ability to query, modify, or remove anything from the LDAP tree. It could also allow other advanced injection techniques that perform other more serious attacks.
Scanner was able to detect a page that is vulnerable to LDAP injection based on known error messages.
SolutionIt is recommended that untrusted data is never used to form a LDAP query.
To validate data, the application should ensure that the supplied value contains only the characters that are required to perform the required action. For example, where a username is required, then no non-alphanumeric characters should be accepted.
If this is not possible, special characters should be escaped so they are treated accordingly. The following characters should be escaped with a `\`:
* `&` * `!` * `|` * `=` * `<` * `>` * `,` * `+` * `-` * `'` * `'` * `;`
Additional character filtering must be applied to:
* `(` * `)` * `\` * `/` * `*` * `NULL`
These characters require ASCII escaping.