T05 · Unauthorized Access and Privilege Escalation
- Location
server/mcp_server.py:31- Finding
Unauthenticated Network-Facing WebSocket Hardware Bridge
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly aligned with controlling a PartyKeys MIDI keyboard, but it exposes an unauthenticated network hardware-control bridge and has risky setup behavior that should be reviewed before installation.
Install only if you are comfortable exposing a local hardware-control bridge. Run it on a trusted network or behind firewall rules, back up ~/.openclaw/mcp.json and ~/.openclaw/openclaw.json before setup, and prefer a version that binds to localhost or uses an explicit pairing token, pinned dependencies, and a safe config merge.
server/mcp_server.py:31Unauthenticated Network-Facing WebSocket Hardware Bridge
scripts/setup.sh:78Destructive Replacement of Existing OpenClaw MCP Configuration
scripts/setup.sh:50Unpinned Runtime Dependency Installation and Incomplete Dependency Declaration
If the implementation performs BLE scanning/connection or claims listening/follow features that are not accurately represented, the skill creates a trust and consent problem around nearby-device access and actual behavior. Hidden or inaccurately described hardware access is security-relevant because Bluetooth discovery and connection can expose local devices and exceed user expectations.
If the implementation performs BLE scanning/connection or claims listening/follow features that are not accurately represented, the skill creates a trust and consent problem around nearby-device access and actual behavior. Hidden or inaccurately described hardware access is security-relevant because Bluetooth discovery and connection can expose local devices and exceed user expectations.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
result["message"] = f"已通过脚本连接设备:{result['address']}"
else:
# 未指定模式或指定 mobile/web 时,返回统一的连接提示
local_ip = subprocess.run(
"ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | head -1",
shell=True, capture_output=True, text=True
).stdout.strip() or "<本机 IP>"
The skill advertises executable setup and clearly relies on networked WebSocket control, yet it does not declare any explicit tool scope such as allowed tools or permissions. That omission weakens reviewability and policy enforcement because consumers cannot easily see that shell execution and network access are part of the skill's operation.
The natural-language instructions, headings, and usage guidance are all presented in Chinese, which effectively forces a specific language for users of the skill. Under the policy, language constraints should be optional or clearly justified as region-specific; neither is stated here.
Natural-language strings and descriptions in the file are presented exclusively in Chinese, including the module description and user-facing tool descriptions/messages. The file does not offer a language choice or explain that the skill is intentionally region- or locale-specific, which can violate language/locale policy requirements.
The server binds a WebSocket service to 0.0.0.0:18790 and accepts arbitrary clients with no authentication, authorization, origin checks, or session binding. Any reachable client can connect, send status/command/result frames, and participate in relaying control messages to other clients and potentially attached hardware.
Exposing an unauthenticated command-and-control WebSocket service on all interfaces is dangerous because users may unknowingly make hardware control reachable from other hosts on the LAN or beyond. In this skill's context, the service is specifically meant to bridge remote commands to a physical MIDI device, which increases the practical risk of unauthorized control and traffic interception.
Incoming WebSocket messages of type command and result are forwarded among connected clients without trust boundaries, message authentication, or confidentiality controls. This allows one client to inject spoofed commands/results, observe or influence another client's session, and potentially capture device-related activity or user interaction data.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
result["message"] = f"已通过脚本连接设备:{result['address']}"
else:
# 未指定模式或指定 mobile/web 时,返回统一的连接提示
local_ip = subprocess.run(
"ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | head -1",
shell=True, capture_output=True, text=True
).stdout.strip() or "<本机 IP>"
The manifest describes controlling the PartyKeys MIDI keyboard via WebSocket, including listening to playing and follow mode for music teaching. This module instead scans for nearby BLE devices and connects directly over Bluetooth, and its follow mode contains a TODO rather than real MIDI input listening, so the implemented behavior does not match the described interface and capabilities.
The function is documented as '跟弹模式' (follow-play mode), which implies reacting to a user's played notes. In practice, it only lights each note, sleeps briefly, and appends success=True for every note, while the inline TODO explicitly acknowledges that MIDI input listening is not implemented.
Line L128 tells the user to test the skill with a specific Chinese-language phrase, which imposes a language expectation in natural-language instructions. There is no indication that the skill is region-specific or that users may use another language, so this conflicts with the policy against forcing a specific language without opt-in.
The manifest says the skill can connect the device, light keys, listen to playing, play sequences, and provide follow mode for teaching. The tool list additionally implements changing device mode, octave, BPM, beat type, skin, querying firmware version, and querying device presence, which materially exceeds the narrower feature set claimed in the manifest description.
The skill executes a shell command via subprocess.run(..., shell=True) to inspect host network configuration. While this may be part of connection setup, this file does not provide a direct warning or disclosure that system shell commands will be executed on the host.
The code starts the WebSocket server on port 18790, but the user-facing instructions for the GitHub Pages/Vercel connection path tell users to connect to ws://{local_ip}:9528/ws. This is an active contradiction in inline user guidance, not merely an omission.
The dependency mcp>=1.0.0 is not pinned to an exact version, which makes builds non-reproducible and can silently introduce vulnerable or incompatible releases during installation. Because mcp also has known advisories, leaving the version open increases supply-chain risk and makes it impossible to verify whether deployed environments are affected.
mcp>=1.0.0
aiohttp>=3.9.0
mcp has multiple known advisories, and because the manifest does not pin a version, there is no reliable way to determine whether installs will pull a vulnerable release. In an agent skill context, mcp is part of the protocol/server surface, so dependency uncertainty on this package is more dangerous than a purely local utility library.
The dependency aiohttp>=3.9.0 is not pinned to a specific version, so future installs may resolve to different releases with different security properties. This creates a supply-chain and reproducibility problem, especially for a network-facing component likely using aiohttp for HTTP or WebSocket handling.
mcp>=1.0.0
aiohttp>=3.9.0
aiohttp has known security advisories, and the unpinned requirement means different environments may install versions that are vulnerable without visibility or control. Since this skill exposes WebSocket/network functionality, weaknesses in aiohttp can directly affect remote attack surface and therefore raise the practical risk.
The code scans nearby Bluetooth devices and connects to a selected address, which involves interacting with external devices and collecting nearby device identifiers. Aside from terse Chinese docstrings, there is no user-facing prompt, log, or comment warning that device discovery and connection will occur.
The skill sends initialization and lighting commands to a Bluetooth device via write_gatt_char, which changes device state. The code contains no user-facing warning, confirmation, or explanatory logging that commands will be transmitted to the external device.