-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 CVE-2026-90979: Apache Karaf: LDAP filter injection in JAAS LDAP login modules Severity: moderate Affected versions: - - - Apache Karaf before 4.4.12 Description: LDAPCache and LDAPBackingEngine build LDAP search filters for user lookup and role lookup by textually substituting the placeholders %u, %dn, and %fqdn (drawn from the login name, the resolved user DN, and its fully qualified namespace form) into administrator-configured filter templates (userFilter, roleFilter). Before the fix, the only sanitization applied to the substituted value was double backslashed: filter = filter.replaceAll(Pattern.quote("%u"), Matcher.quoteReplacement(user)); filter = filter.replace("\\", "\\\\"); This does not escape the other characters RFC 4515 requires escaping in an LDAP search filter: *, (, ), and NUL. A login name containing any of these can change the structure of the resulting filter rather than being matched as a literal value (e.g. a crafted username can turn an equality match into a wildcard match, or close/reopen filter clauses), widening what the search returns and potentially causing a login or role lookup to match an LDAP entry other than the intended one, over-granting roles, and depending on deployment-specific filter templates, potentially affecting which account a login resolved to. It's not exploitable through every entry points: LDAPLoginModule and LDAPPubkeyLoginModule both called Util.doRFC2254Encoding() (correct RFC 4515 escaping) on the login name before handing it to LDAPCache, which masked the missing escaping in LDAPCache for those two call paths. Using LDAPCache directly (bypassing the login modules) does not reproduce through the normal LDAPLoginModule/LDAPPubkeyLoginModule authentication flow for this reason. It does reproduce through two other call paths that reach LDAPCache/LDAPBackingEngine without any prior escaping: * GSSAPILdapLoginModule passes the NameCallback name straight through, unescaped. * LDAPBackingEngine (listRoles) passes principal.getName() straight through, unescaped. This issue is being tracked as https://github.com/apache/karaf/pull/2880 Credit: Gjoko Krstic (reporter) References: https://karaf.apache.org/ https://www.cve.org/CVERecord?id=CVE-2026-90979 https://github.com/apache/karaf/pull/2880 -----BEGIN PGP SIGNATURE----- iQJPBAEBCAA5FiEEGqjPktQJpzOT0Lc2v/LuQsgoLnYFAmq6MVkbFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMCwzAAoJEL/y7kLIKC52Zc8P/jmx1PRaqe1w//eK3E8N JNiJ+QHBwlH6+Rax2a82H2ccbnbOc0yX7arE9ixKZFOdO+gsaVyzHpKAk52VNJWQ jmGbrgrLQiscA3bGN1uzhD4Ng1qdFgivc+kpXRoLOYW/XhjI9k5HZO/9/95RkEik 3sb11Eo6yIwjQwB9R/SPqYz1WiPukoyg345tZpqrUInGfG00ofPZrsqbkzOcXNrS QY+U6g+8VEkwOuMtqOIAFRgNE/esOQ6WlC9ppsnVsRZHV2GmNIx45q1pJegoW3z1 SLbUPfzyI8z6TErm4uQNAyAVlhMIgIuLGzW+xqzveWMfLuDQIm/8MJwuQ9EQwYoi /tYxdZ0JQdn7fFfhVYwvQW1i6sHodbKV3kcALM0fnHrSUk8jthu1bhb/zSY1F5T0 bJq5TPBpiNWpnhF/UkEXEZt9jsmFq5NGEqgFs+Eau1axzjfgPkZggdMvZOAWZoJx +FVWS96IidqP0crP9op6uxBzGcLdaFk9EhaVuU3f+Kie6jmvWR1z7bZBTHzib9Ww m46qrMl1ARrOvJyOgXiQvUIvZ1OYU4UhfFr7geC0M860qFV9cgrkhHTUg+soYAxD 6wzYiMi1qTVKeVMAt56LfFcsG3HotG3y7LvmICqb9e9kdckI3d6MUTYeJBsd4OeN n6qWrl75UMdkINSvbyxLAoRM =6avn -----END PGP SIGNATURE-----