MODERATE

CVE-2026-59368

LdapQueryBuilder Silently Discards Existing Filter When Built From Another Query in Spring LDAP

Description

LdapQueryBuilder can lose a search filter that an application expects to be enforced, causing an LDAP search to run with broader criteria than intended.

When a builder is created from an existing query, the filter carried over from that query is not treated as established. A later call that specifies a filter then replaces the carried-over filter instead of being rejected, so the original criteria are dropped without any error. The fix turns this into an IllegalStateException.

Preconditions:

The application derives one LdapQueryBuilder from another query and then specifies a further filter on the derived builder The dropped filter is what restricts the search, for example to a single tenant, organizational unit, or set of entries

When the dropped filter was acting as an authorization boundary, an authenticated user can read directory entries outside the scope the application intended.

Affected Maven artifacts (1)

ArtifactAffected versionsFixed in
org.springframework.ldap » spring-ldap-core
>= 3.1.0, <= 3.2.19>= 3.3.0, <= 3.3.9>= 4.0.0, < 4.0.7>= 4.1.0, < 4.1.3
4.0.7, 4.1.3

Blast radius

1affected artifacts
49affected versions
384dependent artifacts (est.)
21,330dependent versions

61% of the dependent artifacts (236) still pull an affected version in their latest release.

DepthDependent versions
Direct
3,247
2 hops
3,999
3 hops
5,093
4 hops
8,400
5 hops
246
6 hops
345

Most used dependents

Computed from the dependency graph of build 20261125.0317 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.