Back to skill

Security audit

unihiker-m10-python

Security checks for vulnerabilities and agentic risk

Overview

The skill’s purpose is coherent, but it needs Review because it runs root-level SSH deployment and package installs and contains a confirmed PowerShell package-install injection risk.

Install only if you are comfortable giving the agent SSH/SCP access to your M10, usually as root. Review every package name before installation, prefer pinned versions from trusted sources, avoid the PowerShell -PipInstall path until it quotes or strictly validates package values, change factory-default credentials, and be careful with audio-recording and pkill examples.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run_on_m10.ps1:60
Finding

Remote Shell Argument Injection Through PipInstall

Content
View full analysis
=!~ ]+$') { Write-Error "PipInstall must contain only package names and version specifiers." exit 1 } ``` ```powershell function Get-PipCommand([string]$package) { switch ($Mode) { "uv" { return "$UvPath pip install $package" } default { return "$PythonBin -m pip install $package" } } } ``` ```powershell if ($PipInstall) { Write-Host "Installing dependency: $PipInstall" if ($OfflinePipInstall) { $offlineInstaller = Join-Path $PSScriptRoot "install_m10_package_offline.ps1" $offlineArgs = @( "-ExecutionPolicy", "Bypass", "-File", $offlineInstaller, $PipInstall, "-M10Host", $M10Host, "-User", $User, "-Mode", $Mode, "-PythonBin", $PythonBin, "-UvPath", $UvPath ) powershell @offlineArgs if ($LASTEXITCODE -ne 0) { Write-Error "Offline dependency installation failed." exit $LASTEXITCODE } } else { $pipCmd = Get-PipCommand $PipInstall ssh -o StrictHostKeyChecking=accept-new "${User}@${M10Host}" $pipCmd ``` ### Technical Analysis The `PipInstall` validation expression permits spaces and the shell redirection characters `<` and `>`. The accepted value is interpolated without shell quoting into a command passed through SSH. OpenSSH invokes the supplied command through the remote user's shell. Consequently, characters such as `>` are interpreted as shell syntax rather than as part of a package specification. Spaces also allow additional pip arguments to be injected. The Bash implementation uses a materially stricter package validator and quotes the package va ...[truncated 1710 chars]
Remediation
View remediation
=!~]+[A-Za-z0-9_.-]+)?$') { throw "Package must be one PyPI package name with optional extras or one version specifier." } ``` 2. Do not concatenate user-controlled values into a remote shell command. Pass the package through a fixed remote helper that receives encoded or positional data and validates it again. 3. If a remote shell remains necessary, apply robust POSIX shell quoting to every dynamic argument. Validation should remain in place as defense in depth. 4. Do not allow arbitrary extra pip options through the package field. Expose any required option as a separately validated parameter. 5. Add negative tests for payloads containing spaces, redirection operators, option prefixes, quotes, command separators, substitutions, and newline characters. 6. Use a non-root deployment account and an isolated virtual environment wherever the board's operation permits it. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/run_on_m10.sh:99
Finding

Unpinned and Unverified Third-Party Packages Are Installed in a Root-Operated Environment

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Rogue AgentSelf-Modification, Session Persistence
Findings (13)

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/install_m10_package_offline.ps1 (reported line 167)May include surrounding context.

text
else
  install_cmd="$python_bin -m pip install --no-index --find-links '$remote_wheelhouse' '$package'"
fi
install_and_clean="$install_cmd; status=\$?; rm -rf '$remote_wheelhouse'; exit \$status"

printf 'Installing from the uploaded wheelhouse...\n'
ssh -o StrictHostKeyChecking=accept-new "$user@$host" "$install_and_clean" || m10_die "The M10 rejected the downloaded wheel set. Review the pip error above."

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/install_m10_package_offline.sh (reported line 159)May include surrounding context.

sh
else
  install_cmd="$python_bin -m pip install --no-index --find-links '$remote_wheelhouse' '$package'"
fi
install_and_clean="$install_cmd; status=\$?; rm -rf '$remote_wheelhouse'; exit \$status"

printf 'Installing from the uploaded wheelhouse...\n'
ssh -o StrictHostKeyChecking=accept-new "$user@$host" "$install_and_clean" || m10_die "The M10 rejected the downloaded wheel set. Review the pip error above."

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill explicitly instructs the agent to use network-capable operations such as ping, SSH, SCP, and package download/upload workflows, but it does not declare any explicit tool scope or allowed-tools/permissions boundary. That creates an authorization gap where a host agent may permit broader network actions than intended, increasing the risk of unintended remote access, file transfer, or package retrieval against user infrastructure.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
77% confidence
Finding

The instruction to proceed 'without asking again' permits the agent to make and execute a dependency installation decision autonomously after prior broad authorization. Because installation triggers network download, file upload, and remote package execution on the device, this reduces user oversight at the exact point where supply-chain and device-modification risk is introduced.

Content

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

bash scripts/install_m10_package_offline.sh --env-file .m10-env.json

text

Then rerun the original program in the same selected environment. Do this without asking again when the import-to-distribution mapping is unambiguous and the user already authorized running the program. Ask before choosing between plausible distributions.

The offline installer must:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The template includes microphone recording to a saved file without any warning, consent step, or guidance on handling recorded audio. In a hardware-control skill for the UNIHIKER M10, this is more dangerous because users may copy the example directly onto a device with an onboard microphone, leading to unannounced capture and storage of sensitive conversations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example embeds a literal Wi-Fi credential string, including a password, in a QR code payload. Even if clearly illustrative, hardcoded secrets in documentation normalize unsafe handling of credentials and can lead users to copy the pattern with real passwords into source files, screenshots, repos, or shared docs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The markdown instructs users to stop a background program via ssh root@10.1.2.3 "pkill -f program.py", which is a destructive action that can terminate matching processes on the remote device. The surrounding text does not warn that this may kill active workloads or affect other matching processes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file documents record(file, duration, ...) and start_record(file)/stop_record() but provides no warning that the skill may capture audio from the device microphone and save it to a file. Because markdown files should disclose behaviors that affect user privacy or data, the omission is a safety-relevant missing warning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script explicitly tells users the factory-default SSH password, which normalizes continued use of default credentials and increases the chance the device remains deployed with a widely known password. In the context of a connectivity helper for a network-reachable embedded device, this makes unauthorized access materially easier if the password has not been changed.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/no-python-workflow.md (reported line 73)May include surrounding context.

md
switch ($Mode) {
        "uv" {
            if ($Background) {
                return "pkill -f $remotePath 2>/dev/null; nohup $UvPath run python $remotePath > $logPath 2>&1 & sleep 2; head -5 $logPath"
            }
            return "$UvPath run python $remotePath"
        }

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/run_on_m10.ps1 (reported line 68)May include surrounding context.

text
switch ($Mode) {
        "uv" {
            if ($Background) {
                return "pkill -f $remotePath 2>/dev/null; nohup $UvPath run python $remotePath > $logPath 2>&1 & sleep 2; head -5 $logPath"
            }
            return "$UvPath run python $remotePath"
        }

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/run_on_m10.ps1 (reported line 74)May include surrounding context.

text
switch ($Mode) {
        "uv" {
            if ($Background) {
                return "pkill -f $remotePath 2>/dev/null; nohup $UvPath run python $remotePath > $logPath 2>&1 & sleep 2; head -5 $logPath"
            }
            return "$UvPath run python $remotePath"
        }

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/run_on_m10.sh (reported line 115)May include surrounding context.

sh
switch ($Mode) {
        "uv" {
            if ($Background) {
                return "pkill -f $remotePath 2>/dev/null; nohup $UvPath run python $remotePath > $logPath 2>&1 & sleep 2; head -5 $logPath"
            }
            return "$UvPath run python $remotePath"
        }