Back to skill

Security audit

RDK YOLO Toolkit

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent RDK X5 YOLO deployment helper, but it gives agents broad local and remote command authority with persistent background execution and unsafe permission examples that users should review before installing.

Install only if you are comfortable with the agent running commands on your machine and RDK device. Prefer a dedicated non-production host or least-privilege account, review every SSH/root/package-install/background-process step before execution, avoid chmod 666 on device nodes, and pin or verify installers and dependencies where possible.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Warning
Location
scripts/install_train_env.sh:10
Finding
Mutable Remote Installer Execution and Unpinned Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install_train_env.sh:10-39` **Additional Location**: `SKILL.md:493-504` **Vulnerability Type**: Remote payload execution and insecure dependency management **Risk Level**: Medium ### Vulnerable Code ```bash # 0) Miniconda(如果没装) if [ ! -d ~/miniconda3 ]; then echo "--- 装 Miniconda ---" cd ~ if [ ! -f Miniconda3-latest-Linux-x86_64.sh ]; then wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh fi bash Miniconda3-latest-Linux-x86_64.sh -b -p ~/miniconda3 fi source ~/miniconda3/etc/profile.d/conda.sh # 1) Conda ToS(conda 26+ 必须) echo "--- accept conda ToS ---" conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main 2>/dev/null || true conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r 2>/dev/null || true # 2) 创建 rdk_env if ! conda env list | grep -q '^rdk_env '; then echo "--- 创建 rdk_env (python 3.10) ---" conda create -n rdk_env python=3.10 -y fi conda activate rdk_env # 3) 装包(清华源 + 长超时,国内必须) PIP_OPTS="-i https://pypi.tuna.tsinghua.edu.cn/simple --timeout 60 --retries 10" echo "--- 装 PyTorch (CUDA 12.1) ---" pip install $PIP_OPTS torch torchvision --index-url https://download.pytorch.org/whl/cu121 echo "--- 装 ultralytics + rdkx5-yolo-mapper + onnx ---" pip install $PIP_OPTS "ultralytics>=8.3.0" rdkx5-yolo-mapper onnx onnxsim echo "--- 修 rdkx5-yolo-mapper 缺的 setuptools ---" pip install $PIP_OPTS setuptools ``` ### Technical Analysis The script downloads a mutable file named `Miniconda3-latest-Linux-x86_64.sh` and immediately executes it without validating a cryptographic checksum or signature. Because the `latest` object can change after the Skill has been reviewed, the effective code executed by the Skill is not fixed by the audited package. The script also installs several third-party packages without exact versions or integrity hashes. The constraint `"ultralytics>=8.3.0"` ...[truncated 1890 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the mutable `latest` URL with a fixed Miniconda release URL. 2. Store the expected SHA-256 digest in the repository and verify it before execution: ```bash MINICONDA_FILE="Miniconda3-py310_XX.X.X-X-Linux-x86_64.sh" MINICONDA_SHA256="<vendor-published-sha256>" wget --https-only --secure-protocol=TLSv1_2 \ "https://repo.anaconda.com/miniconda/${MINICONDA_FILE}" printf '%s %s\n' "$MINICONDA_SHA256" "$MINICONDA_FILE" | sha256sum --check - bash "$MINICONDA_FILE" -b -p "$HOME/miniconda3" ``` 3. Abort installation if integrity verification fails. Do not use `|| true` around security-sensitive validation. 4. Pin every direct and transitive Python dependency to reviewed versions. 5. Generate a lock file containing hashes and install with hash enforcement, for example: ```bash python -m pip install --require-hashes -r requirements.lock ``` 6. Use a single explicitly trusted package source where practical. Document any packages that must come from a separate vendor index. 7. Periodically regenerate and review the lock file rather than allowing automatic upgrades through `>=` constraints. 8. Run installation as an unprivileged dedicated account and avoid using the documented SSH workflow with `root`. 9. Apply the same fixed-version and hash-verification requirements to the duplicate commands in `SKILL.md`. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:828
Finding
World-Writable Permissions Recommended for Hardware Shared-Memory Devices<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:828` **Vulnerability Type**: Excessive device permissions **Risk Level**: Medium ### Vulnerable Code ```bash ⚠️ **`/dev/hbmem*` 设备权限**:默认 root 才能写 hbmem。非 root 用户需 `sudo chmod 666 /dev/hbmem*` 或加入对应 group。 ``` ### Technical Analysis The instruction recommends changing every matching `/dev/hbmem*` device to mode `0666`. This grants read and write permission to all local users and processes, rather than limiting access to the account responsible for camera and inference workloads. Device-node access is enforced by the kernel and the associated driver. Granting global read/write permission removes the normal discretionary access-control boundary. The exact operations available after opening these nodes depend on the `hbmem` driver, but the recommendation unnecessarily exposes the device interface to every local account. The command uses a wildcard and may affect multiple current device nodes. Because direct `chmod` changes are not a durable access-control design, permissions may also become inconsistent after reboot or device recreation. ### Attack Path 1. An administrator follows the Skill's recommendation and executes `sudo chmod 666 /dev/hbmem*`. 2. A separate unprivileged local account or compromised process enumerates the matching device nodes. 3. That process opens the nodes with read or write access that would otherwise have been denied. 4. Subject to the driver's supported operations, it interacts with shared-memory resources used by camera, ROS2, or inference workloads. 5. The process may interfere with legitimate workloads or access data exposed through the device interface. ### Impact Assessment The immediate privilege obtained is unrestricted local read/write access to the affected `hbmem` device nodes. Potential scope includes disruption of shared-memory-backed camera or inference pipelines and unauthorized interaction with data exposed by the driver. This finding does not est ...[truncated 252 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `chmod 666` recommendation. 2. Create a dedicated group for accounts that legitimately require access, such as `hbmem`. 3. Configure a persistent udev rule that assigns the device to that group with mode `0660`, for example: ```udev KERNEL=="hbmem*", GROUP="hbmem", MODE="0660" ``` 4. Add only the ROS2 or inference service account to the group: ```bash sudo usermod -aG hbmem <service-account> ``` 5. Require the user to log out and back in after group membership changes, or restart the relevant service under the updated credentials. 6. Run camera and inference components under a dedicated non-login service account instead of `root`. 7. If supported by the platform, add service sandboxing and device allow-listing so the process can access only the required nodes. 8. Verify the resulting ownership and permissions: ```bash stat -c '%A %U %G %n' /dev/hbmem* ``` 9. If temporary access is unavoidable, prefer narrowly scoped ACLs for a specific account rather than granting access to all users. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Lp3

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding
The skill clearly instructs the agent to execute shell commands locally and over SSH, but no declared permissions are present. That mismatch is dangerous because a host application may expose code-execution capability without transparent consent boundaries, increasing the chance of unintended command execution on local or remote systems.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The README explicitly states that the agent can run Bash locally, connect over SSH, and perform environment installation on remote systems, but it does not present a clear opt-in safety warning about system modification, credential use, or command execution scope. In an agent skill context, this increases the risk of users authorizing destructive or unintended actions without informed consent, especially when remote hosts and package installers are involved.

Vague Triggers

Medium
Confidence
83% confidence
Finding
The trigger condition matches very broad terms like RDK X5, BPU, hb_mapper, and ROS-related keywords without clear exclusions. This can cause the skill to activate in contexts where the user only wants discussion or troubleshooting, leading the agent to request SSH access or propose command execution prematurely.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill includes `pkill -f` process-termination commands that can kill matching processes broadly, with no confirmation or scoping safeguards. On a shared or misconfigured system, this may terminate unrelated workloads or disrupt active robotics/inference services.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script appends to ~/.bashrc to persistently modify PATH without prompting the user or clearly calling out that a shell startup file will be changed. While the added path is not itself malicious, silent persistence changes can surprise users, alter later shell behavior, and create a foothold for unintended command resolution changes across future sessions.

Session Persistence

Medium
Category
Rogue Agent
Content
Agent 会**按节点对话式追问**接入方式(不需要你一次性填表),并按 4 档模式执行:
- **本机直跑** — 你在 GPU 机器上调用,Agent 用 Bash 直接跑
- **SSH 远程** — 你给 ssh,Agent 远程 + tmux/nohup
- **输出指导** — 你说"只要命令",Agent 给你清单 + Checkpoint
- **板端 SSH** — 给 RDK X5 ssh,自动连上去推理 + ROS2
Confidence
84% confidence
Finding
The skill advertises use of tmux/nohup for remote SSH execution, which enables commands to continue running after the initiating session ends. In an agent-driven workflow, persistence mechanisms can leave long-running processes active without sufficient visibility or cleanup, increasing the chance of resource abuse, accidental continued execution, or unauthorized background activity on remote hosts.

Session Persistence

Medium
Category
Rogue Agent
Content
# Step 1: conda 环境 + ToS(conda 26+ 必须)
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
conda create -n rdk_env python=3.10 -y && conda activate rdk_env

# Step 2: 国内必须换源装 PyTorch(pypi 直连必超时)
PIP_OPTS="-i https://pypi.tuna.tsinghua.edu.cn/simple --timeout 60 --retries 10"
Confidence
78% confidence
Finding
Creating and activating a persistent conda environment changes the user's system state beyond a transient session. While common for setup workflows, persistent modifications can have lasting effects, especially if executed automatically on the wrong host or without clear consent.

Session Persistence

Medium
Category
Rogue Agent
Content
usb_zero_copy:=True > usb_cam.log 2>&1 &

# 后台 2: dnn_node(无需任何 topic remap,默认订阅 /hbmem_img)
nohup bash -c "cd /home/root/hobot_ws && \
  ros2 run dnn_node_example example --ros-args \
    -p feed_type:=1 -p is_shared_mem_sub:=1 \
    -p config_file:=config/custom_workconfig.json" > dnn.log 2>&1 &
Confidence
86% confidence
Finding
This command explicitly launches a long-running ROS/dnn process with `nohup ... &`, causing it to persist after the session ends. On a remote robotics device, unattended background services can consume hardware resources, interfere with other workloads, or continue publishing/subscribing unexpectedly.

Session Persistence

Medium
Category
Rogue Agent
Content
# 或 1920x1080: ros2 launch mipi_cam mipi_cam_1920x1080_nv12_hbmem.launch.py

# dnn_node(同 A1,无需改话题)
nohup bash -c "cd /home/root/hobot_ws && \
  ros2 run dnn_node_example example --ros-args \
    -p feed_type:=1 -p is_shared_mem_sub:=1 \
    -p config_file:=config/custom_workconfig.json" > dnn.log 2>&1 &
Confidence
86% confidence
Finding
This is another explicit background-launch command for a persistent ROS/dnn process using `nohup`. Persisting processes on an edge device without strong guardrails can create operational instability and make cleanup difficult if the user did not intend a daemon-like service.

Session Persistence

Medium
Category
Rogue Agent
Content
publish_is_shared_mem:=True > pub.log 2>&1 &

# 后台 2:dnn_node(同 A1)
nohup bash -c "cd /home/root/hobot_ws && \
  ros2 run dnn_node_example example --ros-args \
    -p feed_type:=1 -p is_shared_mem_sub:=1 \
    -p config_file:=config/custom_workconfig.json" > dnn.log 2>&1 &
Confidence
86% confidence
Finding
The command starts a persistent publisher or inference-related process detached from the terminal. In the context of robotics pipelines, this can unexpectedly keep data streams and compute workloads active, which is risky on constrained or shared hardware.

Session Persistence

Medium
Category
Rogue Agent
Content
- `ImportError: utils` → utils/ 目录未传,或目录深度不对(必须 5 层)
- 自定义分辨率推理错位 → 必须 H=W 且能被 32 整除
- SSH 断开训练中断 → 必须用 tmux/nohup
- 板端没 tmux → `apt install tmux` 或直接 `nohup ... > log 2>&1 &`
- `class_names length X is not equal to class_num Y` → cls_names_list 行数 ≠ class_num
- topic list 都有 `/hbmem_img` 和 `/hobot_dnn_detection` 但 `topic hz` 没输出 → publisher 和 dnn_node 的话题名没对齐(默认一个 `/test_msg` 一个 `/hbmem_img`)
- `scp src1 src2 host:dst` 报 `No such file or directory` → 新 OpenSSH(≥ 9.0)行为变了,逐个 scp 或 `scp -r`
Confidence
68% confidence
Finding
The recommendation to `apt install tmux` or use `nohup` increases session persistence by installing tooling or detaching jobs. In this context it appears operational rather than malicious, but it still modifies the system and supports long-lived execution on the target device.

Static analysis

No suspicious patterns detected.