Back to skill

Security audit

huawei-cloud-ecs-passwordless-login

Security checks across malware telemetry and agentic risk

Overview

This skill creates privileged root SSH access to cloud servers and deliberately keeps an active SSH path after key cleanup.

Install only if you intentionally want an agent to create temporary root SSH access to Huawei Cloud ECS instances, modify root authorized_keys, and keep an active SSH ControlMaster session after key cleanup. Prefer a non-root account, require explicit approval before running, review the generated SSH config and cleanup logs, terminate the ControlMaster session when done, and avoid long-lived AK/SK exports in shared shells.

SkillSpector

By NVIDIA
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
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (14)

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The skill explicitly establishes an SSH ControlMaster so access persists after the temporary key is removed, which defeats the stated temporary passwordless-login purpose and leaves a covert, ongoing authenticated channel. In context, this is more dangerous because the manifest and workflow present cleanup as a security feature while intentionally preserving operational access.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The manifest claims automatic cleanup removes keys from both local and remote systems, but the workflow intentionally leaves durable SSH access via ControlMaster and persistent local SSH config changes. This is deceptive behavior that can mislead users into believing access has been fully revoked when it has not.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The cleanup section claims keys are removed while also stating the agent can still connect after cleanup because ControlMaster bypasses re-authentication. This contradiction obscures the real security posture and can cause operators to incorrectly assume access has ended.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The description omits a clear warning that authenticated SSH access remains available after cleanup through the persistent master connection. In this context, omission materially increases danger because users are likely to consent under the assumption that access is strictly temporary.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The acceptance criteria explicitly require passwordless root SSH access, temporary private key generation, and automated deployment/removal of authorized keys, but they do not require any user-facing warning, approval gate, or restrictions on privileged use. In the context of an automation skill, this can normalize high-risk behavior and lead operators to grant broad root access and handle sensitive key material without understanding the security implications, increasing the chance of misuse, persistence gaps, or unauthorized access if cleanup fails.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The guide instructs users to place Huawei Cloud access keys in shell environment variables without warning that these secrets may be exposed through shell history, process inspection, inherited environments, CI logs, or accidental debugging output. In the context of a skill that automates IAM and COC operations against cloud infrastructure, compromise of AK/SK credentials could enable unauthorized cloud API access and broader account abuse.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The verification guidance explicitly validates passwordless SSH as root and direct modification of `/root/.ssh/authorized_keys`, but does not require an explicit warning, scope restriction, or safer alternative account. In a skill that automates temporary key deployment to cloud instances, this increases the chance of unsafe use on production systems and normalizes a high-privilege access pattern that could weaken host integrity if misapplied or cleanup fails.

Credential Access

High
Category
Privilege Escalation
Content
**Mandatory.** Start a background timer that fires after `cleanup_delay` seconds (default: 60):

1. Remove `coc-temp-key` line from remote `/root/.ssh/authorized_keys`
2. Delete the COC script via `DeleteScript`
3. Delete local key files from `<temp_dir>/`
Confidence
89% confidence
Finding
/.ssh/authorized_keys

Credential Access

High
Category
Privilege Escalation
Content
"name": "coc_ssh_key_setup",
    "type": "SHELL",
    "description": "Deploy SSH public key for passwordless login",
    "content": "#!/bin/bash\nset -e\nmkdir -p /root/.ssh && chmod 700 /root/.ssh\necho $PUBLIC_KEY >> /root/.ssh/authorized_keys\nchmod 600 /root/.ssh/authorized_keys\necho KEY_DEPLOYED_SUCCESSFULLY",
    "properties": {
      "risk_level": "LOW",
      "version": "1.0.0"
Confidence
94% confidence
Finding
/.ssh/authorized_keys

Credential Access

High
Category
Privilege Escalation
Content
"name": "coc_ssh_key_setup",
    "type": "SHELL",
    "description": "Deploy SSH public key for passwordless login",
    "content": "#!/bin/bash\nset -e\nmkdir -p /root/.ssh && chmod 700 /root/.ssh\necho $PUBLIC_KEY >> /root/.ssh/authorized_keys\nchmod 600 /root/.ssh/authorized_keys\necho KEY_DEPLOYED_SUCCESSFULLY",
    "properties": {
      "risk_level": "LOW",
      "version": "1.0.0"
Confidence
94% confidence
Finding
/.ssh/authorized_keys

Credential Access

High
Category
Privilege Escalation
Content
# Remove public key from remote
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
  -o ConnectTimeout=5 -i <temp_dir>/coc_ssh_key root@<EIP> \
  "sed -i \"/coc-temp-key/d\" /root/.ssh/authorized_keys" 2>/dev/null || true
# Delete COC script
<hcloud> COC DeleteScript --script_uuid="<script_uuid>" 2>/dev/null || true
# Delete local keys
Confidence
85% confidence
Finding
/.ssh/authorized_keys

Credential Access

High
Category
Privilege Escalation
Content
| Check | Method |
|--------|--------|
| 60s timer started | Agent announces cleanup countdown and PID |
| Remote key removed | `sed -i '/coc-temp-key/d' /root/.ssh/authorized_keys` executed on target |
| COC script deleted | `DeleteScript --script_uuid="<uuid>"` exits 0 |
| Local keys deleted | `<temp_dir>/coc_ssh_key` and `.pub` no longer exist |
| Fallback ready | If SSH removal fails, COC cleanup script is created and executed |
Confidence
93% confidence
Finding
/.ssh/authorized_keys

Session Persistence

Medium
Category
Rogue Agent
Content
- The COC script is created via `--cli-jsonInput` with a JSON file, not inline `--content="..."` — inline quoting causes parsing errors with shell special characters in the script body
- The COC script is **parameterized** with `PUBLIC_KEY` — it persists across invocations and can deploy different keys
- If the COC script already exists from a previous run, it is **reused** rather than recreated
- The cleanup uses `nohup bash -c '...' &` + `disown` to survive parent shell exit; output is logged to `<temp_dir>/coc_cleanup.log` for verification. The old `(sleep N && ...) &` pattern loses stdout when the parent shell exits in non-interactive mode
- Private keys are stored in `<temp_dir>` and should never be committed to VCS
- The `sed` cleanup target `coc-temp-key` matches the key comment set during `ssh-keygen`
- After cleanup, use `ssh <EIP>` (no key file needed) — ControlMaster socket handles authentication
Confidence
88% confidence
Finding
nohup

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Content
"name": "coc_ssh_key_setup",
    "type": "SHELL",
    "description": "Deploy SSH public key for passwordless login",
    "content": "#!/bin/bash\nset -e\nmkdir -p /root/.ssh && chmod 700 /root/.ssh\necho $PUBLIC_KEY >> /root/.ssh/authorized_keys\nchmod 600 /root/.ssh/authorized_keys\necho KEY_DEPLOYED_SUCCESSFULLY",
    "properties": {
      "risk_level": "LOW",
      "version": "1.0.0"
Confidence
97% confidence
Finding
echo $PUBLIC_KEY >> /root/.ssh/authorized_keys\nchmod 600 /root/.ssh/authorized_keys

VirusTotal

VirusTotal findings are pending for this skill version.

View on VirusTotal

Static analysis

No suspicious patterns detected.