cwe-90-ldap-injection

Remediate CWE-90 LDAP injection vulnerabilities in Java code with parameterized filters.

3|1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/DevelopersCoffee/java-cwe-security-skills --skill cwe-90-ldap-injection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cwe-90-ldap-injection
Source: https://github.com/DevelopersCoffee/java-cwe-security-skills/tree/main/cwe-90-ldap-injection
Command: npx skills add https://github.com/DevelopersCoffee/java-cwe-security-skills --skill cwe-90-ldap-injection

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses and remediates CWE-90 (LDAP Injection) vulnerabilities in Java applications, preventing unauthorized access and manipulation of directory services.

Core Features & Use Cases

  • Vulnerability Identification: Detects patterns where user input is directly concatenated into LDAP filters.
  • Secure Code Generation: Provides deterministic, parameterized code to safely construct LDAP queries.
  • Use Case: When a SAST tool flags a Java method for potential LDAP injection due to unsanitized user input in an LDAP filter, this skill can be used to automatically rewrite the vulnerable code to use parameterized queries and proper escaping.

Quick Start

Use the cwe-90-ldap-injection skill to remediate the LDAP injection vulnerability in the provided Java code snippet.

Frequently Asked Questions about cwe-90-ldap-injection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix LDAP injection vulnerabilities flagged by a SAST tool in Java code?

To fix LDAP injection vulnerabilities in Java, replace direct string concatenation of user input into LDAP search bases and filters with parameterized LDAP queries and proper escaping of special characters.

What is LDAP injection and how does it affect Java directory services?

LDAP injection occurs when unsanitized user input is concatenated directly into LDAP filters, allowing unauthorized access and manipulation of directory services in Java applications.

How do I implement parameterized LDAP filters using JNDI in Java?

Implementing parameterized LDAP filters using JNDI involves avoiding direct concatenation of user input and instead using secure coding practices to construct LDAP queries with properly escaped special characters.

Does Java JNDI support parameterized queries for preventing CWE-90 LDAP injection?

Java JNDI supports secure interaction with directory services by enabling parameterized LDAP filters and proper escaping of special characters to prevent CWE-90 LDAP injection vulnerabilities.

What is the best way to securely construct LDAP search bases in Java applications?

The best way to securely construct LDAP search bases in Java is to use parameterized queries and proper escaping of special characters rather than directly concatenating user input into directory service queries.

When do I need to escape special characters in Java LDAP filters?

You need to escape special characters in Java LDAP filters whenever user input is incorporated into search bases and filters, preventing direct concatenation vulnerabilities and unauthorized directory service manipulation.