CVE-2026-7551
Description
HKUDS OpenHarness contains a remote code execution vulnerability in the /bridge slash command that allows remote senders accepted by configuration to execute arbitrary operating system commands. Attackers can invoke the /bridge spawn command with attacker-controlled command text that is forwarded to the bridge session manager and executed through the shared shell subprocess helper, allowing them to spawn shell sessions as the OpenHarness process user and access local files, credentials, workspace state, and repository contents.
Affected products
1Patches
1438e37309778fix: keep bridge command local-only by default
3 files changed · +75 −1
src/openharness/commands/registry.py+9 −1 modified@@ -1847,7 +1847,15 @@ async def _ship_handler(args: str, context: CommandContext) -> CommandResult: registry.register(SlashCommand("rewind", "Remove the latest conversation turn(s)", _rewind_handler)) registry.register(SlashCommand("files", "List files in the current workspace", _files_handler)) registry.register(SlashCommand("init", "Initialize project OpenHarness files", _init_handler)) - registry.register(SlashCommand("bridge", "Inspect bridge helpers and spawn bridge sessions", _bridge_handler)) + registry.register( + SlashCommand( + "bridge", + "Inspect bridge helpers and spawn bridge sessions", + _bridge_handler, + remote_invocable=False, + remote_admin_opt_in=True, + ) + ) registry.register(SlashCommand("login", "Show auth status or store an API key", _login_handler)) registry.register(SlashCommand("logout", "Clear the stored API key", _logout_handler)) registry.register(SlashCommand("feedback", "Save CLI feedback to the local feedback log", _feedback_handler))
tests/test_commands/test_registry.py+18 −0 modified@@ -130,6 +130,24 @@ async def test_reload_plugins_command_supports_explicit_remote_admin_opt_in(tmp_ assert getattr(command, "remote_admin_opt_in", False) is True +@pytest.mark.asyncio +async def test_bridge_command_is_marked_local_only(tmp_path: Path, monkeypatch): + monkeypatch.setenv("OPENHARNESS_CONFIG_DIR", str(tmp_path / "config")) + registry = create_default_command_registry() + command, _ = registry.lookup("/bridge spawn id") + assert command is not None + assert command.remote_invocable is False + + +@pytest.mark.asyncio +async def test_bridge_command_supports_explicit_remote_admin_opt_in(tmp_path: Path, monkeypatch): + monkeypatch.setenv("OPENHARNESS_CONFIG_DIR", str(tmp_path / "config")) + registry = create_default_command_registry() + command, _ = registry.lookup("/bridge spawn id") + assert command is not None + assert getattr(command, "remote_admin_opt_in", False) is True + + @pytest.mark.asyncio async def test_memory_show_rejects_path_traversal(tmp_path: Path, monkeypatch): monkeypatch.setenv("OPENHARNESS_CONFIG_DIR", str(tmp_path / "config"))
tests/test_ohmo/test_gateway.py+48 −0 modified@@ -464,6 +464,54 @@ async def fake_start_runtime(bundle): assert updates[-1].text == "/permissions is only available in the local OpenHarness UI." +@pytest.mark.asyncio +async def test_runtime_pool_blocks_bridge_spawn_from_remote_messages(tmp_path, monkeypatch): + workspace = tmp_path / ".ohmo-home" + initialize_workspace(workspace) + handler_called = False + + async def forbidden_bridge_handler(args, context): + nonlocal handler_called + handler_called = True + return CommandResult(message="spawned") + + async def fake_build_runtime(**kwargs): + class FakeEngine: + messages = [] + total_usage = UsageSnapshot() + + def set_system_prompt(self, prompt): + return None + + command = SlashCommand( + "bridge", + "Inspect bridge helpers and spawn bridge sessions", + forbidden_bridge_handler, + remote_invocable=False, + remote_admin_opt_in=True, + ) + return SimpleNamespace( + engine=FakeEngine(), + session_id="sess123", + current_settings=lambda: SimpleNamespace(model="gpt-5.4"), + commands=SimpleNamespace(lookup=lambda raw: (command, "spawn id")), + ) + + async def fake_start_runtime(bundle): + return None + + monkeypatch.setattr("ohmo.gateway.runtime.build_runtime", fake_build_runtime) + monkeypatch.setattr("ohmo.gateway.runtime.start_runtime", fake_start_runtime) + + pool = OhmoSessionRuntimePool(cwd=tmp_path, workspace=workspace, provider_profile="codex") + message = InboundMessage(channel="feishu", sender_id="u1", chat_id="c1", content="/bridge spawn id") + updates = [u async for u in pool.stream_message(message, "feishu:c1")] + + assert handler_called is False + assert updates[-1].kind == "final" + assert updates[-1].text == "/bridge is only available in the local OpenHarness UI." + + @pytest.mark.asyncio async def test_runtime_pool_allows_opted_in_remote_admin_commands(tmp_path, monkeypatch, caplog): workspace = tmp_path / ".ohmo-home"
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3- github.com/HKUDS/OpenHarness/commit/438e37309778e19060dfe7b172eb142e543c4cd6nvdPatch
- github.com/HKUDS/OpenHarness/pull/208nvdExploitIssue TrackingPatchThird Party Advisory
- www.vulncheck.com/advisories/hkuds-openharness-remote-command-execution-via-bridge-slash-commandnvdThird Party Advisory
News mentions
0No linked articles in our index yet.