Back to skill

Security audit

huawei-cloud-ascend-command

Security checks for vulnerabilities and agentic risk

Overview

This NPU management skill needs review because its SSH password handling and destructive-command safeguards have concrete weaknesses.

Wait for SSH identity verification, safer password input, and consistent write confirmation and retry handling before using this on production or shared servers. Avoid the world-writable device workaround, and approve persistent SSH service changes separately. Explicitly identify the intended NPU host and device. Review covered all bundled source files and used isolated stubs; actual hardware effects and installed dependency versions remain unverified.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/npu_client.py
Finding

SSH connections accept arbitrary server keys before sending passwords

Content
View full analysis

Impact

The impersonating server can capture the SSH password and fabricate device-management results. A reusable password can subsequently enable unauthorized access to the actual server.

T09 · Insecure Skill Coding Practices

Warning
Location
references/troubleshooting.md
Finding

Permission troubleshooting grants every local user access to all matching NPU devices

Content
View full analysis

Impact

Untrusted local users gain OS-level permission to open the matching NPU devices, removing the device-file access restriction protecting shared accelerator resources.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/executor.py
Finding

Direct command entry points bypass the promised destructive-operation confirmation

Content
View full analysis

Impact

Destructive vNPU operations and firmware changes can execute without the promised review-and-confirm opportunity, potentially disrupting workloads on the selected device.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (24)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

Setting all matching NPU device nodes to mode 666 grants every local user read/write access, removing the device-node permission boundary. On shared compute hosts, this can permit unauthorized accelerator use or interference with other workloads; labeling the workaround 'less secure' does not mitigate that access.

Content

Scanner excerpt · references/troubleshooting.md (reported line 175)May include surrounding context.

usermod -aG video $USER

Or set permissions (less secure)

chmod 666 /dev/davinci*

text

## 3. Command Execution Issues

Code capability 'network' detected in scripts/executor.py but not covered by declared permissions.

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'network' capability that is not covered by the declared 'allowed-tools' preapproval. Review the host runtime's actual enforcement policy; runtime permissions are unknown unless separately verified, and this declaration alone does not establish a permission ceiling.

Content

No source excerpt is available for this finding.

The trigger list includes everyday terms without requiring Ascend NPU context.

Medium
Category
Trigger Abuse
Confidence
98% confidence
Finding

The activation rule includes common words such as 'health', 'memory', and 'certificate' without requiring NPU-related intent. This can route unrelated requests into an operational skill and cause unintended device queries, although the documented write confirmations limit the demonstrated impact.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
- Local mode needs **no** Python package beyond the standard library.
- SSH mode needs `paramiko`; it is imported lazily, so local mode still works when it is absent.
- The target machine must have CANN/`npu-smi` installed — run `npu-smi info` there once to confirm.
- **Security**: never read, echo or print password values; never ask the user to paste a password into the conversation; read credentials only from the `--password` command-line argument.

## Core Workflow

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/acceptance-criteria.md (reported line 30)May include surrounding context.

md
| AC-2.6 | Should set performance mode | `Set performance mode` command |
| AC-2.7 | Fan mode maps to `pwm-mode` (ISSUE-001) | `Set fan auto` shows `Set fan to auto mode`; after `confirm` dispatches `npu-smi set -t pwm-mode -d 1`; `Set fan manual` → `-d 0` |
| AC-2.8 | Fan speed maps to `pwm-duty-ratio` | `Set fan speed 70` → gate `Set fan speed to 70%`; after `confirm` dispatches `npu-smi set -t pwm-duty-ratio -d 70` |
| AC-2.9 | `set fan` without direction or number must clarify (ISSUE-001) | `set fan` returns a clarification request (`auto` / `manual` or 0-100) and arms no confirmation gate — it must **not** default to 50% |
| AC-2.10 | `set ECC` without direction must clarify (ISSUE-004) | `set ECC` returns `Please specify direction: 'enable ECC' or 'disable ECC'`; must **not** silently default to disable |

### 3. Firmware Management

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/command-mapping.md (reported line 60)May include surrounding context.

md
| Input | Behavior |
|-------|----------|
| `set ECC` (no enable/disable) | Replies `Please specify direction: 'enable ECC' or 'disable ECC'`; no confirmation gate is armed |
| `set fan` (no mode word, no number) | Asks for `auto` / `manual` or a `0-100` speed; **never** defaults to 50% |
| `set fan speed` (no number) | Asks for a `0-100` value; no confirmation gate is armed |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/command-mapping.md (reported line 62)May include surrounding context.

md
|-------|----------|
| `set ECC` (no enable/disable) | Replies `Please specify direction: 'enable ECC' or 'disable ECC'`; no confirmation gate is armed |
| `set fan` (no mode word, no number) | Asks for `auto` / `manual` or a `0-100` speed; **never** defaults to 50% |
| `set fan speed` (no number) | Asks for a `0-100` value; no confirmation gate is armed |

**Fan mapping notes**

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/configuration.md (reported line 56)May include surrounding context.

md
| Input | Behavior |
|-------|----------|
| `set fan` (no `auto`/`manual`, no number) | Asks the user to specify `auto` / `manual` or a `0-100` speed. **No** confirmation gate is armed and **no** default such as 50% is assumed. |
| `set fan speed` (no number) | Asks for a `0-100` value; no confirmation gate is armed. |

**Routing rule:** the fan **mode** branch is evaluated first and covers
`fan mode`, `auto fan`, `manual fan`, `fan auto`, `fan manual`,

Generic temperature and firmware keywords can trigger the NPU skill without an Ascend-specific request.

Medium
Category
Trigger Abuse
Confidence
93% confidence
Finding

The orchestration procedure describes selecting the operational skill using generic trigger keywords without explicitly checking the requested hardware domain. This permits unintended routing and device inspection, though explicit connection parameters and write confirmations constrain the consequences.

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 · references/certificate-management.md (reported line 179)May include surrounding context.

md
**Solution:**
1. Use valid certificate format (PEM/DER)
2. Run as root
3. Verify certificate file path

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 · references/virtualization.md (reported line 179)May include surrounding context.

md
**Solution:**
1. Check resource allocation
2. Update firmware
3. Run as root

### Issue: vNPU performance slow

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/configuration.md (reported line 92)May include surrounding context.

md
`disable`/`off`)

**Behavior:** replies `Please specify direction: 'enable ECC' or 'disable ECC'`.
No confirmation gate is armed and **disable is never assumed** — an unspecified
direction must not silently disable ECC (ISSUE-004).

**Sensitive:** Requires confirmation only after the direction is explicit

Generic natural-language command phrases can trigger NPU queries outside the intended context.

Medium
Category
Trigger Abuse
Confidence
94% confidence
Finding

The command mappings include unqualified phrases such as Health check, Temperature, Usage, and Topology, which also occur in unrelated requests. Although the reference concerns NPUs, it does not explicitly require an established NPU context for these phrases or provide exclusions.

Content

No source excerpt is available for this finding.

The bare trigger `Rollback` does not specify firmware or an NPU target.

Medium
Category
Trigger Abuse
Confidence
90% confidence
Finding

The listed trigger Rollback also commonly refers to reverting code, database transactions, or deployments. Unlike the firmware-qualified alternatives, it has no explicit activation constraint or exclusion, so unrelated rollback requests could enter the firmware rollback flow.

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 · references/firmware-upgrade.md (reported line 183)May include surrounding context.

md
**Solution:**
1. Verify firmware file integrity
2. Run as root
3. Stop all NPU processes
4. Free up disk space

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 · references/troubleshooting.md (reported line 74)May include surrounding context.

md
1. Read the exit code and stderr summary in the `Message` line.
2. Re-run the same command directly via passthrough to see the full output:
   `python3 scripts/main.py --command "npu-smi info -l"`.
3. Common causes: insufficient permissions (run as root), device busy,
   unsupported sub-command for the chip, invalid firmware path.

**`NPU-TIMEOUT`**

The troubleshooting workflow starts SSH and enables it at boot without warning about persistent remote-access exposure.

Medium
Category
Output Handling
Confidence
91% confidence
Finding

The solution instructs the agent to run systemctl start sshd and systemctl enable sshd, changing the target machine's running services and boot configuration. It does not warn that this can enable remote login on reachable interfaces and persist across reboots, or ask the user to approve that change.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% 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/troubleshooting.md (reported line 124)May include surrounding context.

bash
# On target machine
systemctl start sshd
systemctl enable sshd

2. NPU-SMI Issues

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/troubleshooting.md (reported line 222)May include surrounding context.

md
**Expected behavior:** Single device ~2 seconds, multi-device should be parallel

**Solution:** The skill automatically runs multi-device tests in parallel

## 5. Compatibility Issues

SSH verification examples pass passwords on the command line without warning about local credential exposure.

Medium
Category
Output Handling
Confidence
98% confidence
Finding

The examples encourage passing SSH passwords as command-line arguments, which can expose real credentials through process inspection, shell history, or execution logs when users replace the placeholders. Using root in the examples increases the consequences of credential disclosure.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/executor.py (reported line 711)May include surrounding context.

python
output = self.client._execute(cmd)
        else:
            try:
                result = subprocess.run(shlex.split(cmd), shell=False, capture_output=True, text=True, timeout=120)
            except FileNotFoundError:
                return ("❌ ascend-dmi not found: install CANN/ascend-dmi on the target host, "
                        "or run with --host for SSH remote mode (B115-5)")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/executor.py (reported line 770)May include surrounding context.

python
output = self.client._execute(cmd)
                else:
                    try:
                        result = subprocess.run(shlex.split(cmd), shell=False, capture_output=True, text=True, timeout=120)
                    except FileNotFoundError:
                        results[npu_id] = {'error': 'ascend-dmi not found: install CANN/ascend-dmi or use --host'}
                        return

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/npu_client.py (reported line 185)May include surrounding context.

python
# Local direct mode: execute npu-smi directly
        import shlex
        try:
            result = subprocess.run(
                shlex.split(command), shell=False,
                capture_output=True, text=True, timeout=60
            )

Unverifiable Dependency: paramiko has 12 known advisory(ies) (CVE-2018-7750 (Paramiko not properly checking authentication before processing other requests); CVE-2023-48795 (Prefix Truncation Attack against ChaCha20-Poly1305 and Encrypt-then-MAC aka Terr); CVE-2018-1000805 (Paramiko Authentication Bypass vulnerability) +9 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The allowed range includes Paramiko versions predating the Terrapin mitigation, including 2.11 and 3.x releases before 3.4. This is a dependency-policy weakness for an SSH management skill, although the installed version is unknown and the advisory count does not prove that every listed CVE applies.

Content

No source excerpt is available for this finding.