Skip to content

GHSA-cqh3-jg8p-336j CVE-2026-42568

Yamcs Vulnerable to LDAP Injection in LdapAuthModule

Medium Maven
Severity
4.3 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
1.03%
Chance of exploitation in the next 30 days. Higher than 63.64% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-90 Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')
Fix
5.12.7
Upgrade org.yamcs:yamcs-core to this version or later

Description

Summary

An LDAP injection vulnerability exists in org.yamcs.security.LdapAuthModule when constructing search filters. The username parameter is inserted directly into the LDAP filter without proper RFC 4515 escaping.

Root Cause

File: yamcs-core/src/main/java/org/yamcs/security/LdapAuthModule.java:233

The username parameter is inserted directly into an LDAP search filter without RFC 4515 escaping:

// VULNERABLE
var filter = userFilter.replace("{0}", username);
var searchResult = getSingleResult(ctx, userBase, filter, controls);

LDAP wildcard characters (*, (, )) are accepted without sanitization.

Impact

With a known valid password, username=* authenticates as the first user returned by the LDAP search — enabling horizontal privilege escalation between accounts sharing similar passwords or when the attacker knows one valid password.

This affects deployments that use org.yamcs.security.LdapAuthModule in their etc/security.yaml configuration file.

Proof of Concept

curl -X POST "http://TARGET:8090/auth/token" \
  -d "grant_type=password&username=*&password=known_password"
# Returns token for first matching LDAP user

Fix

Apply RFC 4515 escaping before filter construction:

private static String escapeLdapFilter(String input) {
    return input
        .replace("\\", "\\5c")
        .replace("*",  "\\2a")
        .replace("(",  "\\28")
        .replace(")",  "\\29")
        .replace("\0", "\\00");
}
var filter = userFilter.replace("{0}", escapeLdapFilter(username));

Affected versions

Maven

PackageVulnerableFixed in
org.yamcs:yamcs-core
< 5.12.7
5.12.7

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

org.yamcs:yamcs-core Maven → 5.12.7

maven
<dependency><groupId>org.yamcs</groupId><artifactId>yamcs-core</artifactId><version>5.12.7</version></dependency>
gradle
implementation("org.yamcs:yamcs-core:5.12.7")

Severity breakdown

CVSS 3.1 4.3

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

Weakness

CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')

The product constructs all or part of an LDAP query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended LDAP query when it is sent to a downstream component.

How to prevent it
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-9272-wg2r-7xmx
Yamcs has DOM XSS in Extension Routing
Medium Also affects org.yamcs:yamcs-core
GHSA-c64q-hj4j-375f
Yamcs vulnerable to authenticated remote code execution via unescaped StreamSQL `LIKE` pattern compiled by Janino (`LikeExpression`)
Critical Also affects org.yamcs:yamcs-core
GHSA-73mf-m39p-wpm9
Yamcs vulnerable to Remote Code Execution via instance-template argument YAML injection (createInstance)
Critical Also affects org.yamcs:yamcs-core
GHSA-9jg3-g3wh-w9pj
Yamcs has Unauthenticated Directory Traversal
High Also affects org.yamcs:yamcs-core
GHSA-rxpg-wjf8-qv9c
Yamcs has Reflected XSS in the URL of the Authorize Endpoint
Medium Also affects org.yamcs:yamcs-core
GHSA-cvw4-55pp-3hfq
Yamcs's Missing Authorization on Role and Privilege Enumeration Endpoints Allows Any Authenticated User to Disclose Full Security Configuration
Medium Also affects org.yamcs:yamcs-core
GHSA-fwww-cp23-7f5g
Yamcs's WebSocket subscription handlers omit the privilege checks their REST siblings enforce
Medium Also affects org.yamcs:yamcs-core
GHSA-962x-ccwf-8x6p
Yamcs Core API has Multiple Missing Function Level Access Control vulnerabilities
High Also affects org.yamcs:yamcs-core
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor