
CVE-2026-104885 の概念実証および差分検証ラボ。これは OpenRemote の認可バイパスであり、任意の認証済みユーザーが他のレルムの 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");
}
}
修正はセッション所有者のレルムに対して認可を行います:
// 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 の認証済みユーザーが、レルム B のユーザーが所有するブローカーセッションを、セッション ID を推測または把握するだけで切断できてしまいました。修正では、セッションの接続ユーザー (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) |
|---|---|---|
| クロスレルム | 切断 | not_found (User session not found in realm) |
| 同一レルムの他ユーザー (非管理者) | 切断 | forbidden (Can only disconnect own user sessions...) |
| 同一レルムの自分自身 | 切断 (正当) | 切断 (正当) |
| 同一レルムの他ユーザー (管理者) | 切断 (正当) | 切断 (正当) |
キャプチャ済み実行: 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 を介してセッション所有者を解決し、
セッションが存在しない場合 / 所有者が削除済みの場合 / レルムが一致しない場合は 404 を返し、
読み取りアクセス (throwIfCannotReadUserInRealm) を要求し、
自分自身の切断、または同一レルムの他ユーザーに対する
write:admin/スーパーユーザーのみを許可する。クロスレルムおよび未承認の
同一レルム切断はブロックされるが、正当な自分自身/管理者による切断は引き続き
機能する。クロスレルムの経路は残っていない。
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)