Back to skill

Security audit

Uds Diagnostic Test

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real UDS/CAN testing tool, but it needs review because it can make persistent privileged host changes and run state-changing ECU tests with weak guardrails.

Only install this on a dedicated, authorized ECU test bench or isolated lab machine. Do not add the recommended NOPASSWD sudoers rule on a shared workstation, review any generated test script before running it, and avoid running the full suite against production vehicles or ECUs unless reset, clear-DTC, write, SecurityAccess, memory, and transfer-path tests are explicitly approved.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/uds_test_generator.py:5814
Finding

Generated Python Code Injection Through Unescaped Template Values

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
README.md:141
Finding

Overbroad Persistent Passwordless Sudo Authorization

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/setup_env.sh:197
Finding

Runtime Installation of Unpinned and Unhashed Dependencies

Content
View full analysis
=4.0.0 openpyxl>=3.0.0 ``` ```bash if [ -f "$SKILL_DIR/requirements.txt" ]; then "$VENV_DIR/bin/python" -m pip install $pip_flags -U pip setuptools wheel || install_failed_msg "$VENV_DIR" "$VENV_DIR/bin/python" -m pip install $pip_flags --no-cache-dir -r "$SKILL_DIR/requirements.txt" || install_failed_msg "$VENV_DIR" else "$VENV_DIR/bin/python" -m pip install $pip_flags -U pip setuptools wheel || install_failed_msg "$VENV_DIR" "$VENV_DIR/bin/python" -m pip install $pip_flags --no-cache-dir python-can openpyxl || install_failed_msg "$VENV_DIR" fi ``` The index can also be inherited from the environment: ```bash PIP_INDEX_URL="${PIP_INDEX_URL:-}" ... [ -n "$PIP_INDEX_URL" ] && pip_flags="-i $PIP_INDEX_URL" ``` ### Technical Analysis The dependency declarations use open-ended minimum versions rather than reviewed exact versions. The setup script resolves and downloads dependencies at runtime without integrity hashes and also upgrades `pip`, `setuptools`, and `wheel` to mutable current releases. Package provenance can be changed through the ambient `PIP_INDEX_URL` environment variable. Consequently, two installations performed at different times or on differently configured systems can retrieve different code even when the Skill package itself is unchanged. Although no malicious dependency was identified in the audited project, this installation design creates a supply-chain vulnerability because compromise of a package release, repository, mirror, DNS/TLS trust environment, or local index configuration can alter the code installed and executed during setup. ### Attack Path 1. An attacker compromises or controls the configured Python package index or influences `PIP_INDEX_URL`. 2. The user runs the mandatory `s ...[truncated 922 chars]
Remediation
View remediation
openpyxl== ``` 2. Generate a lock file containing cryptographic hashes and install with: ```bash python -m pip install --require-hashes -r requirements.lock ``` 3. Pin packaging tools instead of upgrading them to unrestricted current releases. 4. Use an explicitly configured, organization-approved HTTPS index rather than silently inheriting an ambient index. 5. Validate and document the expected package source. Consider rejecting an unexpected `PIP_INDEX_URL` unless the user explicitly approves it. 6. Maintain an offline wheelhouse or signed internal mirror for diagnostic environments with elevated operational sensitivity. 7. Add automated dependency vulnerability scanning and a controlled update process that reviews new versions before changing the lock file. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (72)

Chaining Abuse

High
Category
Tool Misuse
Confidence
86% confidence
Finding

Using a shell pipeline to send generated content into a privileged write (| sudo tee) is a risky pattern because it normalizes low-friction elevation and can be repurposed or copied into unsafe contexts. Here it writes persistent root-owned configuration affecting module autoload, so the chaining pattern meaningfully increases the chance of unintended privileged system modification.

Content

Scanner excerpt · README.md (reported line 74)May include surrounding context.

设置开机自动加载(可选):

bash
echo -e "can\ncan_raw\npeak_usb" | sudo tee /etc/modules-load.d/can.conf

1.3 WSL2:使用内核自带 peak_usb 模块

Chaining Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

This shell pipeline constructs and writes a sudoers rule granting NOPASSWD root access for CAN/network-related commands. Combining dynamically expanded shell content with a privileged write lowers scrutiny and can lead operators or agents to install a dangerous persistent privilege-escalation path on the host.

Content

Scanner excerpt · README.md (reported line 144)May include surrounding context.

2. 配置 sudo 免密(推荐,避免每次输入密码)

bash
echo "$(whoami) ALL=(root) NOPASSWD: /sbin/ip link set can* type can *, /sbin/ip link set can* up, /sbin/ip link set can* down, /sbin/modprobe can*, /usr/bin/fuser -k /sys/class/net/can*" | sudo tee /etc/sudoers.d/can-setup
sudo chmod 440 /etc/sudoers.d/can-setup

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is described as a diagnostic test workflow, but its documented behavior includes system-level CAN interface initialization and possible privileged network reconfiguration. That mismatch is dangerous because users or orchestrators may invoke the skill expecting low-risk test generation while it actually performs host-impacting operations requiring elevated privileges.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill is described as a diagnostic test workflow, but its documented behavior includes system-level CAN interface initialization and possible privileged network reconfiguration. That mismatch is dangerous because users or orchestrators may invoke the skill expecting low-risk test generation while it actually performs host-impacting operations requiring elevated privileges.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 42)May include surrounding context.

md
| `./scripts/setup_env.sh` 不存在 / `SKILL.md` 缺失 | 技能目录不完整。不要手工补目录或补文件,重新获取完整的 `uds-diagnostic-test` 目录 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 62)May include surrounding context.

md
| `./scripts/setup_env.sh` 不存在 / `SKILL.md` 缺失 | 技能目录不完整。不要手工补目录或补文件,重新获取完整的 `uds-diagnostic-test` 目录 |

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Across the template, the generated test suite includes destructive ECU actions such as reset, DTC clearing, security-access brute attempts, memory access, and transfer/programming flows without strong guardrails or safety acknowledgements. In this skill context, those operations can alter vehicle state, lock out security access, interrupt communications, or damage ECU configuration if run on real systems.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The generated runtime script automatically executes privileged system reconfiguration of SocketCAN and attempts to kill processes using the interface via sudo and fuser. That exceeds normal test execution, can disrupt unrelated processes or sessions on the host, and creates a dangerous local-impact surface if the tool is run in shared or production environments.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated script includes direct memory access tests ($23 ReadMemoryByAddress and $3D WriteMemoryByAddress), which go beyond ordinary DID/DTC diagnostics and can expose or modify raw ECU memory. That creates clear risk of confidentiality loss, integrity damage, or device instability if run against production hardware.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

The generator emits runtime code for RequestDownload/Upload, TransferData, TransferExit, and related tests, which can exercise firmware transfer paths rather than passive diagnostics. In an automotive context, these services can alter ECU state, trigger programming workflows, or interact with protected flash routines, so exposing them by default materially increases the chance of unsafe or destructive use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README promotes automated UDS actions against a live ECU, including reset, DTC clearing, write, IO control, routines, and SecurityAccess unlock, but does not prominently warn that these operations can alter ECU state, erase diagnostic data, trigger physical actuator behavior, or disrupt a vehicle/system under test. In this context, omission of a strong safety warning is dangerous because operators or downstream agents may run the workflow on production hardware assuming it is routine and non-destructive.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 32)May include surrounding context.

至少要保证以下 SocketCAN 相关内核模块可用:

bash
sudo modprobe can
sudo modprobe can_raw
sudo modprobe peak_usb

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 33)May include surrounding context.

至少要保证以下 SocketCAN 相关内核模块可用:

bash
sudo modprobe can
sudo modprobe can_raw
sudo modprobe peak_usb

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 34)May include surrounding context.

至少要保证以下 SocketCAN 相关内核模块可用:

bash
sudo modprobe can
sudo modprobe can_raw
sudo modprobe peak_usb

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 48)May include surrounding context.

至少要保证以下 SocketCAN 相关内核模块可用:

bash
sudo modprobe can
sudo modprobe can_raw
sudo modprobe peak_usb

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 49)May include surrounding context.

至少要保证以下 SocketCAN 相关内核模块可用:

bash
sudo modprobe can
sudo modprobe can_raw
sudo modprobe peak_usb

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 58)May include surrounding context.

至少要保证以下 SocketCAN 相关内核模块可用:

bash
sudo modprobe can
sudo modprobe can_raw
sudo modprobe peak_usb

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 59)May include surrounding context.

至少要保证以下 SocketCAN 相关内核模块可用:

bash
sudo modprobe can
sudo modprobe can_raw
sudo modprobe peak_usb

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 106)May include surrounding context.

至少要保证以下 SocketCAN 相关内核模块可用:

bash
sudo modprobe can
sudo modprobe can_raw
sudo modprobe peak_usb

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 144)May include surrounding context.

至少要保证以下 SocketCAN 相关内核模块可用:

bash
sudo modprobe can
sudo modprobe can_raw
sudo modprobe peak_usb

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 145)May include surrounding context.

至少要保证以下 SocketCAN 相关内核模块可用:

bash
sudo modprobe can
sudo modprobe can_raw
sudo modprobe peak_usb

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
88% confidence
Finding

Piping directly into sudo tee to write persistent module autoload configuration modifies privileged system startup behavior. While not inherently malicious, it increases risk on shared or non-dedicated systems by making hardware-related kernel modules load automatically without a documented rollback or warning, and the shell-to-sudo pipeline reduces review friction for a privileged write.

Content

Scanner excerpt · README.md (reported line 74)May include surrounding context.

设置开机自动加载(可选):

bash
echo -e "can\ncan_raw\npeak_usb" | sudo tee /etc/modules-load.d/can.conf

1.3 WSL2:使用内核自带 peak_usb 模块

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
97% confidence
Finding

This line introduces a recommended passwordless sudoers configuration for privileged networking and process-control actions. Recommending this as convenience guidance materially weakens local privilege boundaries on the host used for testing, especially in an agent-operated environment where unattended execution may abuse those rights.

Content

Scanner excerpt · README.md (reported line 141)May include surrounding context.

usbipd attach --wsl --busid

text

### 2. 配置 sudo 免密(推荐,避免每次输入密码)

```bash
echo "$(whoami) ALL=(root) NOPASSWD: /sbin/ip link set can* type can *, /sbin/ip link set can* up, /sbin/ip link set can* down, /sbin/modprobe can*, /usr/bin/fuser -k /sys/class/net/can*" | sudo tee /etc/sudoers.d/can-setup

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README recommends adding passwordless sudo rules for network and module-management operations without a clear warning about privilege expansion and local abuse risk. Granting NOPASSWD access to ip link, modprobe, and fuser on wildcard CAN targets can let a local user or agent repeatedly reconfigure interfaces, kill processes using CAN devices, and perform privileged system changes with reduced oversight.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 145)May include surrounding context.

bash
echo "$(whoami) ALL=(root) NOPASSWD: /sbin/ip link set can* type can *, /sbin/ip link set can* up, /sbin/ip link set can* down, /sbin/modprobe can*, /usr/bin/fuser -k /sys/class/net/can*" | sudo tee /etc/sudoers.d/can-setup
sudo chmod 440 /etc/sudoers.d/can-setup

3. 安装 Python 依赖