Summary
Roxy-WI's LDAP authentication flow up to version 8.2.8.2 constructs LDAP search filters by directly concatenating the user-supplied username without escaping special characters.
An attacker can inject LDAP filter metacharacters into the username field, manipulate which directory entry is returned, and ultimately bypass authentication without knowing any valid password.
Affected context
This vulnerability appears in Roxy-WI deployments that:
- Have LDAP authentication enabled
- Use an LDAP directory (e.g., Active Directory, OpenLDAP) as the backing user store
- Build LDAP search filters from raw user input without escaping or normalizing special characters
The risk is most pronounced where LDAP search results are trusted as proof of identity without additional verification steps.
Exploit preconditions
- Attack surface: Roxy-WI web login endpoint when configured with LDAP authentication
- Required access: Network access to the Roxy-WI login page; no prior authentication is needed
- Trigger point: Submission of a crafted username containing LDAP filter metacharacters (such as wildcards or logical operators)
- Why exploitation is possible: The application interpolates unescaped user input directly into an LDAP search filter; the first or matching directory entry is then treated as the authenticated user, allowing attackers to steer the query to an unintended account or broaden the search.
Why this happens
The underlying bug stems from constructing LDAP search filters through naive string concatenation, treating user-controlled fields as safe components of the query.
Instead of using parameterized or properly escaped LDAP filter APIs, the application embeds the raw username directly into the filter expression.
This pattern aligns with CWE-287 (Improper Authentication): the system accepts proof of identity that can be forged or manipulated, because the LDAP query and its results are implicitly trusted without ensuring that the filter faithfully represents the intended user identity.
Potential impact
- An attacker could log in as an existing directory user without knowing their password.
- Administrative or high-privilege Roxy-WI accounts could be impersonated if the LDAP query can be steered toward privileged entries.
- Unauthorized access to configuration and management of Haproxy, Nginx, Apache, and Keepalived instances managed by Roxy-WI.
- Indirect impact on downstream infrastructure, including traffic routing, SSL termination, and availability settings controlled via Roxy-WI.
General mitigation guidance
Mitigations generally focus on hardening both the LDAP query construction and the surrounding authentication logic:
- Use LDAP APIs that support structured filters or parameterization instead of building filter strings manually.
- Apply strict escaping or canonicalization routines to any user-supplied values incorporated into LDAP filters, ensuring special characters are treated as data, not control symbols.
- Restrict which LDAP attributes can be queried and enforce exact-match filters where feasible, rather than broad or wildcard searches.
- Introduce an additional verification step that binds with the user's DN and password or uses a separate credential check to confirm identity, rather than trusting search results alone.
- Apply least-privilege principles to the LDAP service account used by Roxy-WI so that even if filters are manipulated, the accessible scope is minimized.
How teams detect issues like this
Detection typically blends code-level inspection with runtime monitoring:
- During code review, flag any occurrences where LDAP filters are built via string concatenation using user-controlled fields (e.g., username, email).
- Employ static analysis rules that detect direct interpolation of request parameters into LDAP filter strings or calls to APIs that accept raw filter text.
- Define secure coding guidelines requiring the use of safe LDAP helper functions or libraries, and enforce them through pull request templates or automated linters.
- Monitor authentication logs for anomalous login patterns, such as successful logins using unusual usernames or repeated attempts with usernames containing special characters or filter operators.

