LDAP Injection in CMAK (Cluster Manager for Apache Kafka) via Search Filter
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- scala
- Domain
- authentication, security
Research direction
Start with app/controllers/BasicAuthenticationFilter.scala and inspect renderSearchFilter() around line 264, then review how the username enters the LDAP search filter. Validate the reported special-character cases against the affected versions; done means user input is safely escaped before insertion and the listed injection vectors no longer change the filter meaning.
Written by the indexing model from the issue text.
Description
Summary
Yahoo CMAK (Cluster Manager for Apache Kafka) versions up to and including 3.0.0.6 are vulnerable to LDAP Injection (CWE-90) in the LDAP authentication module.
Vulnerability Details
File: app/controllers/BasicAuthenticationFilter.scala
Function: renderSearchFilter() at line 264
Root Cause: User-supplied username is inserted into LDAP search filter via simple string replacement (%s) without LDAP special character escaping.
Vulnerable Code (line 264):
private def renderSearchFilter(username: String): String = {
searchFilter.replaceAll("%s", username)
}
The function passes raw user input directly into an LDAP search filter string. LDAP metacharacters such as *, (, ), \, and NUL byte are not escaped before insertion.
Attack Vectors
An attacker can inject LDAP filter syntax through the HTTP Basic Authentication username field:
- Wildcard bypass (
*): Matches any LDAP entry, bypassing username validation - Boolean logic injection (
admin)(|(cn=*)): Injects OR conditions to match arbitrary entries - Filter manipulation (
*)(objectClass=*)): Extends filter to match all objects - Attribute enumeration (
*)(mail=*@yahoo.com)): Enumerates entries by attribute
Impact
- Authentication bypass: Attacker can log in as any LDAP user without knowing the password (if LDAP bind is not configured)
- LDAP data exfiltration: Enumeration of LDAP directory entries (usernames, emails, group memberships)
- Authorization escalation: Access admin-level CMAK functions (topic deletion, partition reassignment, broker configuration)
Proof of Concept
A complete Docker-based PoC is available demonstrating 4 confirmed attack vectors against a live CMAK + OpenLDAP setup:
# Attack vector: wildcard authentication bypass
import requests, base64
target = "http://cmak-host:9000/"
# Normal user "admin" → 401 without correct password
# Wildcard "*" → matches all LDAP entries → bypass
cred = base64.b64encode(b"*:anything").decode()
r = requests.get(target, headers={"Authorization": f"Basic {cred}"})
# Returns 200 instead of 401
Recommended Fix
Replace renderSearchFilter with proper LDAP escaping:
import javax.naming.ldap.Rdn
private def renderSearchFilter(username: String): String = {
searchFilter.replaceAll("%s", Rdn.escapeValue(username).toString)
}
This uses javax.naming.ldap.Rdn.escapeValue() which is part of the standard Java/Scala library and properly escapes all LDAP special characters including *, (, ), \, and NUL.
- Dominant language
- No language data
- Stars
- 2.5k
- Forks
- 772
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 49
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/advisory-database
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/advisory-database#9255 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
github/advisory-database#9164 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
github/advisory-database#8994 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/advisory-database#8898 · 4 comments · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
github/advisory-database#7882 · 1 comment ·
All issues in github/advisory-database
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AXERA-TECH/ax-llm#75 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheManticoreProject/Manticore#1383 ·
-
auth bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100