Back to skill

Security audit

huawei-cloud-ascend-remote-connect

Security checks for vulnerabilities and agentic risk

Overview

This server-management skill needs review because its command safeguards can be bypassed and its credential handling can expose privileged access.

Defer production use until command approval, argument quoting, server-key verification and session identity isolation are corrected. Use a restricted account; avoid the unrestricted sudo example and password-bearing command lines or test files. Rotate credentials already exposed through those examples. Manual review covered the partially scanned executor and found no hidden loader; the scanner's missing reference was an example IP address. Validation used static inspection and mocked execution, not live SSH. The evidence supports Review for unsafe implementation, without establishing malicious intent.

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
Finding

SSH server identity is not verified before authentication

Content
View full analysis

Impact

A counterfeit SSH server can receive password-authentication credentials, read submitted commands, and forge command output. Captured passwords can enable subsequent access to the intended server. Key authentication does not itself disclose the private key.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/main.py
Finding

Execution paths bypass destructive-operation confirmation and blocking

Content
View full analysis

Impact

Deletion, recursive permission changes, disk formatting, and other destructive shell operations can run immediately with the selected SSH account's privileges, commonly root in the documented workflow. Direct internal mount dispatch can also modify /etc/fstab without its intended confirmation step.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (45)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The overall SSH administration purpose matches, but the confirmation guarantee does not. In run_one_shot_fast, commands recognized by _is_shell_command—including rm, chmod, kill, and arbitrary shell expressions—are passed directly to SSH without a confirmation check. The --raw paths likewise execute commands directly through SSH or Paramiko. Thus sensitive operations can bypass CommandExecutor regardless of any protections that imported component may provide. The supplied code does not show credential-file storage or unrelated data exfiltration; specialized Ascend functionality delegated to the unavailable executor cannot be independently verified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The validator materially undermines the declared confirmation requirement. For example, sudo reboot, systemctl stop sshd, and lvremove vg/data return ALLOWED. A compound command such as echo ok; reboot also avoids the anchored sensitive-command checks. The allowed-prefix list provides no effective restriction because the final fallback returns ALLOWED for every unmatched command. The chunk only returns classifications and messages; it does not itself obtain confirmation or execute commands. SSH connectivity and in-memory credential handling cannot be assessed from this supporting module alone, and their absence here is not treated as a mismatch.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The administrative functionality broadly matches the description, but the mandatory-confirmation guarantee does not. For example, a ping target containing shell metacharacters is interpolated directly into a command and passed to SessionManager.execute_command through _exec_simple, bypassing CommandValidator and any confirmation step. In addition, _validate_and_execute handles commands beginning with '_set_auto_mount ' before checking sensitivity or the confirmed flag, so direct input can create directories, modify /etc/fstab, and run mount -a without confirmation. These are material safety-behavior mismatches. No Ascend-specific NPU monitoring is visible in this chunk, and memory-only credential handling cannot be verified without the SessionManager implementation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The SSH connectivity and in-memory connection management align with the declared purpose. However, SSHClient.execute passes commands directly to Paramiko exec_command, and ConnectionPool.execute adds no approval check. Thus, this chunk does not enforce the explicitly promised safeguard for sensitive operations; a separate caller could provide it, but none is shown. Additionally, pooled connections are keyed only by host and port, so supplying a different username or credentials for an already-connected endpoint can silently reuse the previous identity. No credential persistence or unrelated data transfer is evident.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Administrative tasks may require elevated privileges, but granting passwordless execution of every command as any user is materially broader than the declared device-management capabilities. The rule persists on disk and removes a security barrier for future privileged commands. Although labeled an example, the supplied shell command performs this sensitive change directly and contains no user-confirmation gate.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

SSH configuration hardening is related to the declared administration scope, but this chunk directly changes persistent access controls and restarts the SSH service. These actions can disrupt remote access, and the supplied code contains no confirmation gate despite the explicit promise that sensitive operations require user confirmation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Although SSH setup and security hardening are related to the declared administration scope, this chunk establishes durable key-based access and changes server authentication policy rather than merely providing a temporary connection. The sensitive configuration change and service restart are also presented as direct commands without the promised confirmation gate.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Inspecting SSH settings supports the declared troubleshooting purpose. However, the supplied commands also enable password authentication when explicitly disabled and restart sshd unconditionally. These are sensitive configuration and service changes, but the code contains no confirmation gate. The mismatch is the absence of the promised safeguard, not an unrelated primary purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Creating a privileged local account is a substantive system-access change, not merely an implementation detail of temporary SSH connectivity or security auditing. The supplied chunk directly creates the account and assigns sudo-group membership without showing the promised confirmation safeguard. A surrounding workflow could provide confirmation, but none is present in the supplied code.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The session-management functionality is consistent with the declared SSH administration purpose. However, the description explicitly promises confirmation before sensitive operations, while execute_command directly calls client.execute(command, timeout) with no confirmation parameter, sensitivity check, or authorization gate. This allows potentially destructive commands through the supplied interface without enforcing that promise. Confirmation could exist in an unseen caller or SSH client, but it is not demonstrated by this chunk. No unrelated resource access or credential persistence is visible.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
87% confidence
Finding

SSH logging and authentication-log monitoring support the declared auditing purpose. However, changing SSH configuration and restarting a remote-access service are sensitive administrative operations. The supplied shell chunk executes them directly without a confirmation gate, contradicting the declared safeguard. The absence of other advertised features in this limited chunk is not itself a mismatch.

Content

No source excerpt is available for this finding.

The suggested sudoers configuration grants unrestricted passwordless administrator access without warning.

High
Category
Output Handling
Confidence
99% confidence
Finding

The purported minimum-privilege configuration actually permits every command as any user without a password. Compromise of the SSH account or misuse of the remote-command agent would therefore provide unrestricted root access, regardless of the documented sensitive-command categories.

Content

No source excerpt is available for this finding.

Troubleshooting guidance encourages finding alternative ways to perform a blocked fork bomb.

High
Category
Prompt Injection
Confidence
92% confidence
Finding

Telling the agent to use alternative approaches for blocked commands, explicitly including a fork bomb, can be interpreted as permission to evade the safety block. Although it may mean finding a benign alternative to the underlying task, the ambiguity is dangerous in a remote execution skill because equivalent resource-exhaustion commands can deny service.

Content

No source excerpt is available for this finding.

Sensitive administrative operations are classified as allowed without requiring confirmation, contrary to the manifest.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The validator allows administrative tools and interpreters without checking their arguments, and even unmatched commands default to ALLOWED. Anchored regular expressions also miss dangerous operations behind wrappers or shell composition, undermining the promised confirmation boundary on potentially privileged remote servers.

Content

No source excerpt is available for this finding.

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

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'mcp' 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.

YARA rule 'privilege_escalation_tools': Privilege escalation tools and techniques [hacktools]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

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

python
2>/dev/null | head -5 || echo "none"')
                elif action == 'system_users':
                    return self._exec_simple('system users', 'echo "=== logged-in users ==="; who 2>/dev/null || echo "none"; echo; echo "=== recent login failures ==="; lastb -10 2>/dev/null || echo "none"')
                elif action == 'suid_check':
                    return self._exec_simple('SUID files', 'find / -perm -4000 -type f 2>/dev/null | head -30')

        # Key generation (sensitive)
        if 'generate key' in text or 'create key' in text:
            key_file = '$HOME/.ssh/oa_ed25519'
            self.pending_confirmation = f'ssh-keygen -t ed25519 -f {key_file} -N "" -q && cat {key_file}.pub'
            return '⚠️ Will generate a new ED25519 key pair and print the public key\n\nPlease reply "confirm" or "cancel"'

        return None

    # ========== Log Module ==========

    def _handle_log_nl(self, text: str) -> Optional[str]:
        """Log-relatednatural language"""

Persistent mount configuration can be changed without the user confirmation required by the manifest.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The internal _set_auto_mount and _repair_fstab_action commands are dispatched before confirmation checks, regardless of the confirmed flag. An active session can therefore invoke these strings directly, modifying persistent mount configuration or triggering mounts without the promised approval.

Content

No source excerpt is available for this finding.

Direct SSH execution bypasses the promised confirmation requirement for sensitive operations.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The fast-mode shell-command branch bypasses CommandExecutor's safety checks and immediately executes the command remotely. With the default root username, an unconfirmed sensitive command can have server-wide consequences; this is the same underlying bypass identified at the subprocess execution site.

Content

No source excerpt is available for this finding.

Code capability 'network' detected in scripts/ssh_client.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 command-execution path does not enforce the manifest's requirement for user confirmation before sensitive operations.

High
Category
Excessive Agency
Confidence
92% confidence
Finding

The supplied execution paths accept arbitrary command strings and dispatch them through Paramiko without checking whether a sensitive operation has received user approval. This undermines the advertised confirmation requirement unless an upstream layer reliably enforces it; disk, LVM, and container administration make unauthorized execution particularly consequential, potentially causing data loss or service disruption within the SSH account's privileges.

Content

No source excerpt is available for this finding.

Password arguments are prescribed without warning about shell-history and process-list exposure.

Medium
Category
Output Handling
Confidence
99% confidence
Finding

The skill prescribes passing passwords through --password, exposing them to command history and potentially process inspection or execution telemetry. Keeping passwords in application memory does not prevent these external disclosures, and privileged server credentials make the exposure consequential.

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 · SKILL.md (reported line 141)May include surrounding context.

md
**Minimum required permissions on target server:**
- SSH access (port 22 or custom)
- Sudo privileges for system management operations

## Core Workflow

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 · SKILL.md (reported line 468)May include surrounding context.

md
### Security Recommendations

1. **Use Key Authentication**: Prefer SSH keys over passwords when possible
2. **Limit Permissions**: Grant minimum sudo privileges needed
3. **Monitor Sessions**: Regularly check active connections
4. **Log Auditing**: Review login logs periodically

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/iam-policies.md (reported line 28)May include surrounding context.

md
## Allowed Commands

### Safe Commands (No confirmation required)
- `npu-smi info` - NPU status check
- `ls`, `cat`, `head`, `tail` - File operations
- `df -h`, `free -h`, `uptime` - System monitoring

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/iam-policies.md (reported line 44)May include surrounding context.

md
### Blocked Commands (Always blocked)
- Fork bomb patterns
- Direct disk formatting without confirmation

## Security Best Practices