/

CVE-2026-25560

Severity:

CRITICAL RISK

(9.8)

LDAP Injection in WeKan LDAP Authentication

CVE-2026-25560

Analyzed

Vulnerability type

Category:

LDAP Injection

CWE:

CWE-90

Impact:

Authentication Bypass and Account Compromise

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

WeKan versions prior to 8.19 contain an LDAP filter injection flaw in the authentication mechanism, where user-controlled usernames are embedded into LDAP search filters and DN-related values without proper escaping.

An attacker can manipulate these LDAP queries during login to bypass authentication, enumerate accounts, or authenticate as other users under conditions where LDAP is used as the identity backend.

Affected context

This vulnerability arises in WeKan deployments configured to use LDAP for user authentication.

The issue occurs when the application constructs LDAP search filters or Distinguished Names (DNs) using raw username input from login forms.

In environments where the LDAP server is reachable from the WeKan instance and the LDAP bind has permission to search or resolve accounts, crafted usernames can alter the intended query logic.

Exploit preconditions

  • Attack surface: Public or internal WeKan login endpoint when LDAP authentication is enabled.
  • Required access: Network access to the WeKan application and the ability to submit arbitrary usernames in the login form or equivalent API.
  • Trigger point: LDAP lookup and bind operations performed during the authentication workflow, where user input is interpolated into filters or DNs.
  • Why exploitation is possible: Username values are concatenated directly into LDAP filter strings and DN components without robust escaping or normalization, allowing attacker-controlled characters (such as LDAP metacharacters) to change query semantics.

Why this happens

The root cause is improper neutralization of special elements used in LDAP queries, aligning with CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection').

Instead of treating the username as data, the authentication logic embeds it directly into search filters and DN strings, enabling attackers to inject LDAP operators, wildcards, or additional conditions.

The underlying insecure pattern is string-based filter construction (e.g., concatenation or string formatting) without using safe LDAP filter-building APIs or encoding routines that escape control characters.

Potential impact

  • An attacker may bypass authentication and log in as another user, including privileged accounts, depending on directory structure and filter logic.
  • An attacker could enumerate valid user accounts by observing differences in authentication responses or timing.
  • An attacker can manipulate LDAP query scopes or conditions to broaden searches beyond intended organizational units.
  • In some directory configurations, an attacker could cause the application to bind against unintended directory entries, impacting authorization decisions.

General mitigation guidance

Effective mitigation focuses on treating LDAP input as data and eliminating manual filter-string construction.

Defensive patterns include:

  • Using library-provided LDAP filter builders or parameterized filter functions that automatically escape user input.
  • Applying strict input validation and canonicalization on usernames (e.g., allowed character whitelists, length limits, and normalization) before constructing any LDAP query elements.
  • Separating static filter logic from dynamic input; keep base filters and DNs constant and inject only properly encoded attribute values.
  • Minimizing LDAP bind and search privileges for the application account so that even malformed filters cannot access unexpected directory branches.
  • Implementing layered authentication checks (e.g., post-bind authorization checks in the application) to reduce reliance on LDAP filter correctness alone.

How teams detect issues like this

Detection commonly involves both code-level and behavior-level analysis:

  • Static analysis: Search for string concatenation or interpolation where user-controlled values (e.g., username, email) are inserted into LDAP filters or DN strings. Flag patterns like ("(" + attr + "=" + userInput + ")") without calls to escaping utilities.
  • Code review: Examine authentication and directory lookup modules for direct construction of LDAP queries, and verify that any dynamic components are encoded using well-defined helper functions.
  • Security testing: Conduct targeted LDAP injection tests against login and directory-backed features, varying special characters and LDAP operators to detect anomalous responses or authentication behavior.
  • Policy enforcement: Integrate secure LDAP usage guidelines into development standards and CI checks, including mandatory use of filter-building APIs and prohibiting raw filter string assembly.

Sources

SourceLink
github.comgithub.com/wekan/wekan/commit/0b0e16c3eae28bbf453d33a81a9c58ce7db6d5bb
wekan.fiwekan.fi/
vulncheck.comvulncheck.com/advisories/wekan-ldap-authentication-filter-injection

Frequently asked

questions

Yes. As long as the WeKan login interface is reachable over the network and LDAP authentication is enabled, a remote attacker can attempt LDAP filter injection through crafted usernames.

Only the ability to submit login requests (e.g., access to the login page or related API) is required. No prior authentication is needed; attacker control of the username field is sufficient to attempt exploitation.

The safest fix is to eliminate manual LDAP filter string construction and instead use vetted LDAP APIs that take raw attribute values and perform necessary escaping. Additionally, enforce strict validation and canonicalization of username inputs before they are used in any directory operation.

Adopt secure coding patterns for all directory interactions: avoid string concatenation for queries, centralize LDAP query construction behind helper functions that handle escaping, enforce input validation on identity fields, and include LDAP injection checks in code review and automated security testing pipelines.

Find out what's already
exploitable in your codebase.