
Proof-of-concept and differential lab for CVE-2026-104885, an OpenRemote authorization bypass letting any authenticated user disconnect MQTT sessions in other realms.
| CVE | CVE-2026-104885 |
| Component | OpenRemote — UserResourceImpl.disconnectUserSession (manager/.../security/UserResourceImpl.java) |
| Affected | before commit 51dce18d |
| Fixed in | commit 51dce18d (GHSA-3h6w-xcw3-9xjj) |
| CWE | CWE-863 (Incorrect Authorization), CWE-285 (Improper Authorization) |
| Impact | The disconnectUserSession endpoint accepts a realm path parameter but ignores it, performing no authorization or realm-boundary check; any authenticated user from any realm can force-disconnect MQTT broker sessions belonging to users in other realms by supplying the target session ID — cross-realm denial of service |
| Vector | Authenticated user from any realm calling the disconnect endpoint |
| Trigger | disconnectUserSession(realm="attacker-realm", sessionID=<victim-realm session>) |
The vulnerable endpoint disconnected the session with no checks:
// UserResourceImpl.disconnectUserSession — pre-fix
public void disconnectUserSession(RequestParams requestParams, String realm, String sessionID) {
if (!mqttBrokerService.disconnectSession(sessionID)) {
throw new NotFoundException("User session not found");
}
}
The fix authorizes against the session owner's 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) took a realm path
parameter but never used it: it called mqttBrokerService.disconnectSession
directly after only the endpoint's generic authentication. There was no
realm-boundary check and no per-user authorization, so an authenticated user
in realm A could disconnect a broker session owned by a user in realm B simply
by guessing/knowing the session ID. The fix resolves the session's connection
user (getConnectionUserId), loads that user, and enforces: 404 for a missing
session, deleted owner, or mismatched realm path; read access to the owner
(throwIfCannotReadUserInRealm); and either self-disconnect or the
write:admin resource role (or superuser) for disconnecting another user in
the same realm.
| service | image | role |
|---|---|---|
or-vuln | cve-2026-104885:vuln | real disconnectUserSession (pre-fix) |
or-fixed | cve-2026-104885:fixed | real method (vendor fix 51dce18d) |
poc | cve-2026-104885-poc:local | stdlib-only Python driver |
A Java harness embeds the real disconnectUserSession method verbatim from
each tag (prefix + method + suffix, compiled with javac). The
infrastructure is stubbed: MQTTBrokerService records disconnect calls and
returns the owner user id, IdentityService returns the owner User/realm,
and the base authorization methods are configurable (admin/non-admin). Both
sides differ only in the upstream method body.
./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 (stdlib only):
51dce18d.A standalone full-chain exploit ships at exploit/exploit.py:
python3 exploit/exploit.py --host=or-vuln
# exit 1 on confirmed cross-realm disconnect, 0 on a safe target
| scenario | or-vuln (pre-fix) | or-fixed (51dce18d) |
|---|---|---|
| cross-realm | disconnected | not_found (User session not found in realm) |
| same-realm other (non-admin) | disconnected | forbidden (Can only disconnect own user sessions...) |
| same-realm self | disconnected (legit) | disconnected (legit) |
| same-realm other (admin) | disconnected (legit) | disconnected (legit) |
Captured runs: 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
network; JDK 17 in the lab images.The fixed disconnectUserSession resolves the session owner via
getConnectionUserId + identityService, returns 404 on missing session /
deleted owner / realm mismatch, requires read access
(throwIfCannotReadUserInRealm), and permits only self-disconnect or
write:admin/superuser for other same-realm users. Cross-realm and unauthorized
same-realm disconnects are blocked; legitimate self/admin disconnects still
work. No cross-realm path remains.
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)