Severity:

HIGH RISK

(8.8)

OS Command Injection in HKUDS OpenHarness /bridge Slash

CVE-2026-7551

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

HKUDS OpenHarness exposes a remote code execution vulnerability in the /bridge slash command that lets configured remote senders trigger arbitrary operating system commands.

By invoking the /bridge spawn command with attacker-controlled text, an attacker can cause the bridge session manager to execute those commands via a shared shell helper, running as the OpenHarness process user and accessing local files, credentials, and repository contents.

Affected context

The vulnerability occurs in OpenHarness deployments that:

  • Enable the /bridge slash command functionality
  • Accept messages from remote senders as configured in the bridge integration
  • Forward user-provided command text to a shell-based helper without robust validation or restriction

It primarily affects environments where the OpenHarness process user has access to sensitive filesystem paths, workspace state, or repository data on the host.

Exploit preconditions

  • Attack surface: Remote over the communication channel that carries /bridge slash commands (e.g., chat or integration transport).
  • Required access: Ability to act as or control a "remote sender" that the OpenHarness bridge is configured to trust and process.
  • Trigger point: Sending a /bridge spawn command containing attacker-chosen command text that is forwarded to the bridge session manager.
  • Why exploitation is possible: The implementation passes untrusted command text into a shared shell subprocess helper with insufficient sanitization or command restriction, enabling arbitrary OS command execution under the OpenHarness process user.

Why this happens

This issue stems from treating user-controlled command text as safe input to a shell execution context.

The /bridge spawn handler forwards incoming slash command arguments directly (or with inadequate validation) to a shared shell subprocess helper, which likely invokes a shell interpreter (for example, via system, popen, or equivalent APIs) rather than a strictly parameterized execution API.

This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where special characters, operators, and argument boundaries in untrusted input are not properly neutralized or constrained before being used to form or invoke operating system commands.

Potential impact

  • Remote execution of arbitrary OS commands as the OpenHarness process user
  • Unauthorized access to local files, including configuration, logs, SSH keys, and cached credentials
  • Reading or modifying workspace state and checked-out repository contents
  • Tampering with build or test artifacts and pipeline outputs
  • Establishing persistence on the host via backdoors or scheduled tasks
  • Lateral movement to other systems accessible from the OpenHarness host

General mitigation guidance

Effective mitigation focuses on eliminating direct shell composition and reducing the trust placed in remote command input:

  • Replace shell-based helpers with parameterized process execution APIs that pass arguments as arrays rather than concatenated strings.
  • Introduce a strict allowlist of permissible commands or sub-commands, rejecting or ignoring any unexpected or free-form command text.
  • Normalize and validate all remote slash command parameters, explicitly disallowing shell metacharacters, pipelines, redirects, and control operators.
  • Consider implementing a dedicated command routing layer that maps high-level actions (e.g., "start session", "run tests") to fixed, server-side command templates without incorporating raw user text.
  • Run the OpenHarness service under a minimally privileged OS account with restricted filesystem and network access, and isolate it using OS-level sandboxing or containerization where practical.
  • Provide operators with configuration options to disable /bridge spawn or similar high-risk features in environments that do not require them.

How teams detect issues like this

Detection typically blends code-focused and operational approaches:

  • Static analysis and code review:
  • Search for uses of shell invocation APIs that concatenate user-supplied data, especially in handlers for /bridge, /bridge spawn, or similar commands.
  • Flag patterns where incoming text from chat or remote integrations is passed into shell helpers without strict validation or an allowlist.
  • Verify that any abstraction around the "shared shell subprocess helper" never accepts raw, arbitrary command strings from untrusted sources.
  • Configuration and policy checks:
  • Enforce policies that prohibit unbounded remote command execution features unless explicitly justified and reviewed.
  • Use secure coding guidelines that mandate parameterized process execution and disallow shell interpretation of external input.
  • Runtime monitoring and logging:
  • Log all uses of /bridge and /bridge spawn with contextual metadata, and monitor for suspicious patterns such as chained commands, redirections, or unusual argument lengths.
  • Track OS-level process creation events for the OpenHarness user, alerting on anomalous command lines, interactive shells, or unexpected tools launched by the service.
  • Automated security scanners and code review tools can be configured to recognize OS command injection patterns and highlight risky shell usage during CI.

Sources

SourceLink
github.comgithub.com/HKUDS/OpenHarness/commit/438e37309778e19060dfe7b172eb142e543c4cd6
github.comgithub.com/HKUDS/OpenHarness/pull/208
vulncheck.comvulncheck.com/advisories/hkuds-openharness-remote-command-execution-via-bridge-slash-command

Frequently asked

questions

Exploitability is limited to entities that can send /bridge slash commands through a channel that OpenHarness trusts. Within that boundary, an attacker can generally execute arbitrary commands as the OpenHarness process user, so the impact can be significant.

No local host access is required, but the attacker must be able to act as a configured remote sender or otherwise access the integration that emits /bridge commands. Whether that involves explicit authentication depends on how the integration and remote sender identities are configured.

The most robust pattern is to remove generic shell command execution from the /bridge spawn path and replace it with strictly parameterized operations: define a closed set of supported actions on the server, map incoming requests to those actions, and execute them via APIs that do not interpret shell metacharacters.

Design remote control and automation features so that clients request high-level operations rather than providing raw command strings. Combine this with secure coding practices that forbid shell concatenation with user input, enforce input validation and allowlists, and subject integration features to targeted security review and automated scanning before deployment.

Find out what's already
exploitable in your codebase.