Back to skill

Security audit

SenseRobot元萝卜AI下棋机器人

Security checks for vulnerabilities and agentic risk

Overview

This skill appears intended for a local chess robot, but it gives an agent high-impact robot-control, camera, microphone, and file-upload abilities without enough scoping, consent, or safety controls.

Review this skill carefully before installing. It is not clearly malicious, but it can move a physical robotic arm, clear a board, take photos, record audio, speak, and upload/display local images over unauthenticated local HTTP. Only use it on a trusted, isolated network with the robot physically supervised, and require explicit user confirmation before motion, board cleanup, photo, recording, or file-upload actions.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/main.py:13
Finding
Unauthenticated Plaintext Control of Physical and Privacy-Sensitive Robot Functions<![CDATA[ ## Vulnerability Details **File Location**: `scripts/main.py:13-33`, with sensitive operations exposed through `scripts/main.py:86-112` **Vulnerability Type**: Unauthenticated plaintext HTTP communication **Risk Level**: High ### Vulnerable Code ```python ROBOT_IP = "192.168.199.10" API_BASE = f"http://{ROBOT_IP}:60010" class RobotClient: """元萝卜机器人控制客户端""" def __init__(self, ip=ROBOT_IP): self.ip = ip self.api_base = f"http://{ip}:60010" # ── HTTP API ── def _api_get(self, path, params=None, binary=False): url = f"{self.api_base}{path}" if params: url += "?" + urllib.parse.urlencode(params, quote_via=urllib.parse.quote) print(f"📡 GET {url}") req = urllib.request.Request(url) with urllib.request.urlopen(req, timeout=30) as resp: data = resp.read() if binary: print(f"✅ 响应: [Binary Data] {len(data)} bytes") return data body = data.decode("utf-8") print(f"✅ 响应: {body[:500]}") return body ``` The same unauthenticated transport is used for privacy-sensitive and file-transfer operations: ```python def show_image(self, image_path): """显示图片""" # Using curl for multipart/form-data upload as it's simpler and more robust # than manual multipart construction in standard library without requests url = f"{self.api_base}/skill-show-image" print(f"📡 POST {url} image={image_path}") try: # Use curl to upload the file cmd = ['curl', '--location', url, '--form', f'image=@"{image_path}"'] result = subprocess.run(cmd, capture_output=True, text=True, check=True) print(f"✅ 响应: {result.stdout[:500]}") return result.stdout except subprocess.CalledProcessError as e: print(f"❌ Curl failed: {e.stderr}") return "" def take_photo(self, camera_id): """拍照 (0=前置 1=右边 2=左边)""" return self._api_get("/ ...[truncated 2922 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace HTTP with HTTPS and validate the robot's certificate. 2. Prefer mutual TLS or certificate/public-key pinning when the robot uses a private certificate authority. 3. Require authentication and authorization for every API operation. Use short-lived, scoped credentials rather than embedding long-lived secrets in source code. 4. Add request integrity and replay protection if TLS cannot be deployed immediately, while recognizing that this is not a full substitute for authenticated encryption. 5. Reject redirects for robot API calls and image uploads, or allow them only after validating that the destination has the expected scheme, host, and port. 6. Validate response status codes, content types, maximum response sizes, and complete JSON schemas before acting on responses. 7. Correlate physical-operation responses with request identifiers and independently verify safety-critical state before initiating a subsequent action. 8. Segment the robot onto a restricted network and limit access to explicitly authorized controller devices with firewall rules. 9. Avoid logging complete URLs when query parameters may contain private speech content or other sensitive information. ]]>

other

Warning
Location
scripts/main.py:154
Finding
Public Placement Command Bypasses the Mandatory Pick-Before-Place Safety Invariant<![CDATA[ ## Vulnerability Details **File Location**: `scripts/main.py:154-169`, `scripts/main.py:176-177`, and `scripts/main.py:230-232` **Vulnerability Type**: Physical actuator safety validation bypass **Risk Level**: Medium ### Vulnerable Code The placement implementation sends `action=2` directly without proving that the same workflow previously completed a successful pickup: ```python def place_stone(self, x, y): """完整落子流程:移动 → 落子""" print(f"🎯 落子到 ({x}, {y})") result = self.move_tcp(x, y, 2) try: res_json = json.loads(result) is_success = res_json.get("ok") and res_json.get("result") == "success" except json.JSONDecodeError: is_success = "0" in result or "ret:0" in result if is_success: print("✅ 落子完成") return True print(f"❌ 落子失败: {result.strip()}") return False ``` The public command invokes that method directly: ```python def cmd_place(args): RobotClient().place_stone(args.x, args.y) ``` Its coordinates are accepted as arbitrary floating-point values without enforcement of the documented board range: ```python p = sub.add_parser("place", help="落子") p.add_argument("x", type=float, help="横坐标") p.add_argument("y", type=float, help="纵坐标") ``` ### Technical Analysis The Skill documentation establishes a mandatory safety invariant: an `action=2` placement must only occur after an `action=1` pickup has returned both `"ok": true` and `"result": "success"`. The CLI does not enforce this invariant. Its `place` command creates a new client and immediately submits a placement operation. The command also lacks local validation that board coordinates are finite and within the documented range of `0` through `12`. Python's floating-point parser can accept special values such as `nan` and `inf`, which would subsequently be serialized into the query parameters. The robot server may reject empty placement, out-of-range coordinates, collisions, or non-finite values. However, relying exc ...[truncated 1650 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the standalone unconditional placement path or clearly restrict it to a privileged diagnostic mode. 2. Implement one atomic pick-and-place operation that: - Detects available stones. - Attempts pickup using the documented retry strategy. - Parses a strict JSON response. - Proceeds only when `ok` is exactly `true` and `result` is exactly `"success"`. - Places the stone only within the same verified operation. 3. Track pickup state explicitly and bind it to the current operation or request identifier. Do not infer state from an unrelated earlier process invocation. 4. Validate that both coordinates are finite with `math.isfinite`. 5. Enforce the documented board bounds: ```python if not (math.isfinite(x) and math.isfinite(y)): raise ValueError("Coordinates must be finite") if not (0 <= x <= 12 and 0 <= y <= 12): raise ValueError("Coordinates must be within the board range") ``` 6. Eliminate permissive fallback checks such as `"0" in result`, because unrelated text containing zero could be misclassified as success. Require a valid response schema and exact success fields. 7. Add a client-side emergency stop, timeout handling, and explicit failure recovery for safety-relevant actuator operations. 8. Retain independent server-side coordinate, collision, action-sequence, and physical-state validation as a second layer of defense. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (22)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared purpose is board/arm control, but the documented behavior also includes taking photos, recording audio, and displaying arbitrary images. That mismatch undermines user and policy expectations and can conceal surveillance or data-capture capabilities behind an innocuous robotics skill.

Missing User Warnings

High
Confidence
97% confidence
Finding
The skill provides recording and photo capabilities without clear privacy warnings, notice, or consent expectations. In a physical environment, undisclosed media capture can expose bystanders and sensitive information, making the omission materially risky.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
Audio recording is broader than the stated function of manipulating Go pieces and controlling the board. In context, this creates an unnecessary surveillance capability that could capture nearby conversations or sensitive speech without clear justification or consent.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill exposes shell/network-capable instructions via curl but declares no explicit tool scope or permission boundary. In an agent environment, this can enable broader-than-expected outbound requests and device control without policy gating, increasing the risk of misuse or accidental invocation.

Vague Triggers

Medium
Confidence
96% confidence
Finding
Broad trigger phrases such as '下棋机器人' or '机械臂控制' without boundary rules can cause accidental skill activation. Because this skill can move a physical robotic arm and access sensors, unintended invocation raises both safety and privacy risks.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill performs physical robot-arm motion and board-clearing operations but does not warn users about mechanical safety, collision risk, or keeping hands/objects clear. In a robotics context, missing safety guidance increases the chance of accidental damage or injury from improper invocation.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
文档中的语音播报接口固定为 `skill-tts-chinese`,示例和速查表也均默认中文内容,未说明是否支持其他语言或由用户选择语言。若技能默认强制特定语言而无用户选择,属于语言/locale 策略风险。

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill documentation exposes camera, microphone, and image-display features that are omitted from the top-level description. Hidden or under-disclosed sensing capabilities are dangerous because users and orchestrators may authorize the skill for robot control without realizing it can capture media or render arbitrary content.

Context-Inappropriate Capability

Medium
Confidence
89% confidence
Finding
Arbitrary image upload/display is outside the stated robot-control purpose and broadens the skill beyond what users would expect. This can be abused to render misleading, offensive, or socially engineered content on the device without clear need for gameplay control.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The board-cleaning endpoint triggers a multi-minute physical action that removes pieces from the board, but the documentation does not clearly warn about irreversible state changes, interruption hazards, or the need for user confirmation. In a physical robotics context, an unexpected cleanup action can disrupt games, damage user trust, and create safety or collision concerns if initiated at the wrong time.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The documented API exposes photo capture, microphone recording, and arbitrary image display capabilities that go beyond the skill's stated chess-robot control purpose. In a robot with cameras, microphone, and display, these undocumented-in-manifest capabilities materially expand the attack surface to privacy invasion, covert sensing, and misleading on-device output if invoked by a user or downstream agent without clear authorization boundaries.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The API reference describes camera and audio recording operations without any warning, consent flow, retention guidance, or privacy constraints. Because these endpoints can capture real-world images and microphone data, omission of privacy controls can enable covert surveillance or accidental collection of sensitive personal information in the robot's environment.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The cheat sheet includes robot actions such as arm reset, pick/place movement, and board cleaning without any safety cautions, precondition checks, or operator warnings. In a physical robotics context, undocumented destructive or motion-causing actions can lead to unintended movement, damage to the board or surroundings, and unsafe invocation by downstream agents.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The cheat sheet documents photo capture, audio recording, and arbitrary image display endpoints that go beyond the stated chess-robot control scope. Exposing surveillance and media/file-handling capabilities without clear scope limitation, consent requirements, or access controls increases the chance that an agent or operator will misuse them for unintended monitoring or content display.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The documentation lists photo capture, audio recording, and file-upload/image-display endpoints without privacy warnings, consent requirements, or data-handling constraints. In practice, this can normalize collection of sensitive audio/images and ingestion of arbitrary files by an agent, creating privacy, compliance, and misuse risks beyond normal chess-robot operation.

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
The module docstring and multiple command/help strings are written only in Chinese, and the API method `tts` explicitly targets `/skill-tts-chinese`. This indicates a language-specific skill behavior without any visible opt-in, language selection, or justification that the skill is intended only for a Chinese-language context.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The skill exposes camera capture, audio recording, and arbitrary image display capabilities that go beyond the stated robot-board-control purpose. Extra device capabilities widen the privacy and safety surface, especially for a robot in a physical environment, and could be abused by a caller to capture local surroundings or audio without clear user expectation.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
show_image accepts an arbitrary local path and uploads that file to the robot service, enabling unintended exfiltration of local files readable by the process if an attacker can influence the argument. Although intended for image display, the lack of path restrictions, file-type validation, and purpose limitation makes this dangerous in an agent context.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
try:
            # Use curl to upload the file
            cmd = ['curl', '--location', url, '--form', f'image=@"{image_path}"']
            result = subprocess.run(cmd, capture_output=True, text=True, check=True)
            print(f"✅ 响应: {result.stdout[:500]}")
            return result.stdout
        except subprocess.CalledProcessError as e:
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
The TTS section states that `content` is limited to Chinese content only, which is a language-policy constraint expressed in natural language. Because the document does not offer user opt-in/choice or explain a region-specific justification, this matches the locale/language policy concern under SQP-3.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The documented endpoint is specifically `skill-tts-chinese`, which indicates a fixed language choice in the skill behavior. Because the file does not mention that Chinese output is optional, configurable, or limited to a justified region-specific context, this appears to violate the language/locale choice policy.

Static analysis

No suspicious patterns detected.