
CVE-2026-104885에 대한 개념 증명 및 차등 실험실로, OpenRemote의 인가 우회 취약점으로 인해 인증된 모든 사용자가 다른 realm의 MQTT 세션 연결을 끊을 수 있습니다.
| CVE | CVE-2026-104885 |
| 구성 요소 | OpenRemote — UserResourceImpl.disconnectUserSession (manager/.../security/UserResourceImpl.java) |
| 영향 받는 버전 | 커밋 51dce18d 이전 |
| 수정된 버전 | 커밋 51dce18d (GHSA-3h6w-xcw3-9xjj) |
| CWE | CWE-863 (부적절한 권한 부여), CWE-285 (부적절한 인가) |
| 영향 | disconnectUserSession 엔드포인트는 realm 경로 매개변수를 받지만 이를 무시하며, 권한 부여나 영역 경계 검사를 수행하지 않습니다. 어떤 영역의 인증된 사용자든 대상 세션 ID를 제공하여 다른 영역 사용자의 MQTT 브로커 세션을 강제로 연결 해제할 수 있습니다 — 교차 영역 서비스 거부 |
| 벡터 | 어떤 영역의 인증된 사용자가 연결 해제 엔드포인트를 호출 |
| 트리거 | disconnectUserSession(realm="attacker-realm", sessionID=<victim-realm session>) |
취약한 엔드포인트는 아무런 검사 없이 세션 연결을 해제했습니다:
// UserResourceImpl.disconnectUserSession — pre-fix
public void disconnectUserSession(RequestParams requestParams, String realm, String sessionID) {
if (!mqttBrokerService.disconnectSession(sessionID)) {
throw new NotFoundException("User session not found");
}
}
수정 사항은 세션 소유자의 realm에 대해 권한을 부여합니다:
// fixed (commit 51dce18d)
String connectionUserId = mqttBrokerService.getConnectionUserId(sessionID);
User connectionUser = identityService.getIdentityProvider().getUser(connectionUserId);
String connectionRealm = connectionUser.getRealm();
if (!connectionRealm.equals(realm)) throw new NotFoundException("User session not found in realm");
throwIfCannotReadUserInRealm(connectionRealm, connectionUserId);
boolean hasAdminWriteRole = hasResourceRoleOrIsSuperUser(ClientRole.WRITE_ADMIN.getValue(), ...);
if (!hasAdminWriteRole && !Objects.equals(getUserId(), connectionUserId))
throw new ForbiddenException("Can only disconnect own user sessions unless you have role 'write:admin'");
disconnectUserSession(RequestParams, realm, sessionID)는 realm 경로
매개변수를 받았지만 결코 사용하지 않았습니다. 엔드포인트의 일반 인증만 거친 직후
mqttBrokerService.disconnectSession를 직접 호출했습니다. 영역 경계 검사도, 사용자별 권한 부여도
없었기 때문에, 영역 A의 인증된 사용자가 세션 ID를 추측하거나 알고 있기만 하면
영역 B의 사용자가 소유한 브로커 세션의 연결을 끊을 수 있었습니다. 수정 사항은
세션의 연결 사용자(getConnectionUserId)를 확인하고, 해당 사용자를 로드한 뒤
다음을 강제합니다: 세션이 없거나, 소유자가 삭제되었거나, 영역 경로가 일치하지
않으면 404; 소유자에 대한 읽기 접근(throwIfCannotReadUserInRealm); 그리고 동일 영역 내
다른 사용자의 연결을 끊으려면 자기 자신의 연결을 끊거나
write:admin 리소스 역할(또는 슈퍼유저)을 보유해야 합니다.
| 서비스 | 이미지 | 역할 |
|---|---|---|
or-vuln | cve-2026-104885:vuln | 실제 disconnectUserSession (수정 전) |
or-fixed | cve-2026-104885:fixed | 실제 메서드 (벤더 수정 51dce18d) |
poc | cve-2026-104885-poc:local | 표준 라이브러리만 사용하는 Python 드라이버 |
Java 하네스는 각 태그(prefix + method + suffix, javac으로 컴파일)에서
실제 disconnectUserSession 메서드를 그대로 내장합니다. 인프라는 스텁으로
대체됩니다: MQTTBrokerService은 연결 끊기 호출을 기록하고 소유자 사용자 ID를
반환하며, IdentityService은 소유자 User/영역을 반환하고,
기본 권한 부여 메서드는 구성 가능합니다(관리자/비관리자). 양쪽은 업스트림 메서드
본문에서만 다릅니다.
./run-lab.sh build # builds both sides (eclipse-temurin:17-jdk)
./run-lab.sh up # cve104885lab network: or-vuln / or-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py (표준 라이브러리만 사용):
51dce18d.독립 실행형 전체 체인 익스플로잇은 exploit/exploit.py에 포함되어 있습니다:
python3 exploit/exploit.py --host=or-vuln
# exit 1 on confirmed cross-realm disconnect, 0 on a safe target
| 시나리오 | or-vuln (수정 전) | or-fixed (51dce18d) |
|---|---|---|
| 교차 realm | disconnected | not_found (User session not found in realm) |
| 동일 realm 다른 사용자 (비관리자) | disconnected | forbidden (Can only disconnect own user sessions...) |
| 동일 realm 본인 | disconnected (정상) | disconnected (정상) |
| 동일 realm 다른 사용자 (관리자) | disconnected (정상) | disconnected (정상) |
캡처된 실행: evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/exploit-standalone-run.txt, evidence/exploit-standalone-fixed-run.txt,
evidence/versions.txt, evidence/0day-sweep.txt.
cve104885lab
네트워크 상의 제한된 컨테이너; 랩 이미지의 JDK 17.수정된 disconnectUserSession은 getConnectionUserId + identityService를 통해
세션 소유자를 확인하고, 세션 누락 / 소유자 삭제 / realm 불일치 시 404를 반환하며,
읽기 접근(throwIfCannotReadUserInRealm)을 요구하고, 본인 연결 해제 또는
동일 realm의 다른 사용자에 대해 write:admin/슈퍼유저만 허용합니다. 교차 realm 및
권한 없는 동일 realm 연결 해제는 차단되며, 정당한 본인/관리자 연결 해제는 여전히
작동합니다. 교차 realm 경로는 더 이상 남아 있지 않습니다.
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
exploit/exploit.py standalone full-chain exploit
lab/lab.Dockerfile builds both sides from upstream method source
lab/vendor/ verbatim disconnectUserSession from pre-fix / fix commits
lab/prefix.java infrastructure stubs + harness class header
lab/suffix.java harness main (scenario driver)
lab/gen.py assembles prefix + method + suffix
lab/service.py HTTP wrapper (POST /disconnect)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)