Back to skill

Security audit

huawei-cloud-migration-windows-ecs

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious with high confidence because it reports serious security and operational risks in a Windows cloud migration tool, while some packaged executable behavior remains unverified.

Consider the suspicious verdict and serious reported risks before installing. In particular, review the executable files' provenance and behavior, and determine whether the proxy, storage, credential, cleanup, and provisioning actions are safe for your environment. Scanner coverage was partial, so the findings do not establish that unreviewed or partially analyzed material is safe.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/windows_migration/phases/configure_phase.py
Finding

Unauthenticated HTTP download becomes an elevated executable

Content
View full analysis

Impact

Arbitrary elevated code execution on the source server. The replacement executable also receives the path of the already-created file containing cloud AK/SK credentials.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/windows_migration/proxyopt/scripts/proxy_setup_squid.sh
Finding

Squid allow rule bypasses destination-port restrictions

Content
View full analysis

Impact

Unauthorized TCP tunneling to services reachable from the jump host, bypassing the stated migration-port limits and enabling network pivoting. Explicitly configuring a narrow source CIDR does not remove the automatically added RFC1918 ranges.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/windows_migration/proxyopt/scripts/sandbox_http_server.py
Finding

Configured bearer-token protection is unconditionally bypassed

Content
View full analysis

Impact

Unauthorized listing and download of files in the configured distribution directory despite explicitly enabled authentication.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/windows_migration/sms_task.py
Finding

Cloud provisioning completes before the required confirmation

Content
View full analysis

Impact

Billable ECS, disk, and networking resources can be created, security-group rules changed, and EIPs bound before approval. Rejecting the prompt or running noninteractively does not prevent those preceding changes.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (94)

The WinRM setup command lacks a warning about its security impact.

High
Category
Output Handling
Confidence
97% confidence
Finding

The recommended command enables remote administration over HTTP, sets TrustedHosts to '*', and adds an inbound firewall rule without restricting remote addresses. HTTP does not necessarily mean unencrypted WinRM messages with every authentication mechanism, but these settings unnecessarily broaden management access and weaken host trust, especially in a skill supporting public-network migration.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Squid evaluates http_access rules in order. The generated configuration places http_access allow localnet before http_access deny !Safe_ports and http_access deny CONNECT !SSL_ports. Consequently, clients matching localnet are allowed immediately, regardless of destination port, and the advertised CONNECT restrictions are ineffective. By default, localnet includes all RFC1918 networks and loopback, plus any configured source CIDR; configuring all or 0.0.0.0/0 extends this unrestricted access to every reachable client. Installing and managing Squid is consistent with the declared purpose, but the broader proxy capability materially contradicts its explicit port restriction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The SMS Agent restart is reasonably related to migration support. However, this script additionally performs materially significant, undeclared source-storage modifications. Its existing-partition branch can format the first non-NTFS volume on the selected disk with confirmation disabled. No system-disk guard is implemented, and automatic discovery simply selects the first partitionless disk larger than 1 GB rather than matching --size-gb. These behaviors exceed the declared target-disk orchestration and are not merely supporting migration implementation details.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Remote execution and file transfer are reasonable supporting capabilities for migration-agent deployment. However, transfer_file also invokes ensure_defender_exclusion, which runs Add-MpPreference -ExclusionPath on the remote host. This is a security-relevant configuration change beyond ordinary file transfer: it excludes a directory from Defender scanning, has no separate consent gate in this chunk, and has no corresponding removal shown here. The description does not disclose antivirus exclusions. Disabled HTTPS certificate validation is an additional security concern, but not independently treated as a purpose mismatch. The broader migration features cannot be verified from this executor module alone.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- Windows Agent 安装/自动化:`references/sms-agent-guide.md`、`references/sms-agent-automation-guide.md`

Credential clipboard automation lacks a warning about exposure in the interactive session.

High
Category
Output Handling
Confidence
97% confidence
Finding

The documented automation places cloud credentials into the interactive clipboard and copies them back for validation, exposing them to clipboard observers in that session. No clipboard clearing or history protection is shown, and theft of the cloud secret key could enable access beyond the source machine.

Content

No source excerpt is available for this finding.

Disk consolidation and removal are recommended without warning about data loss or service interruption.

High
Category
Output Handling
Confidence
96% confidence
Finding

The troubleshooting advice recommends consolidating or removing source disks without requiring dependency checks, backups, or a maintenance window. In a migration skill operating on live Windows systems, following this advice can interrupt services or omit required data from the migration; actual data destruction depends on how the operator implements it.

Content

No source excerpt is available for this finding.

The existing-server migration workflow lacks a warning that replication can overwrite destination disk data.

High
Category
Output Handling
Confidence
95% confidence
Finding

The workflow favors an existing destination server and provides commands to start block replication without explicitly warning that destination disk contents can be overwritten. Generic confirmation flags and disk-mapping checks do not establish that existing destination data is disposable, making this omission dangerous in a production migration workflow.

Content

No source excerpt is available for this finding.

Proxy cleanup can terminate unrelated services and delete unverified shared directories.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Cleanup kills whichever process listens on port 8080, stops the system-wide Squid service, and recursively removes fixed directories without verifying that they belong to this migration. On a shared jump host, the general cleanup confirmation does not establish ownership and can lead to unrelated service outages or permanent data loss.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Both directory trees are removed recursively without validation that their current contents are migration-owned. This overlaps the /data/downloads finding rather than representing a separate injection vector, but it confirms an unsafe destructive cleanup boundary on potentially shared infrastructure.

Content

Scanner excerpt · scripts/windows_migration/cleanup_environment.py (reported line 140)May include surrounding context.

python
("停止 gost 服务", "systemctl stop gost-proxyopt 2>/dev/null; systemctl disable gost-proxyopt 2>/dev/null; echo DONE"),
        ("停止 HTTP 8080 文件服务", "P=$(ss -tlnp | grep ':8080 ' | grep -oP 'pid=\\K[0-9]+' | sort -u); [ -n \"$P\" ] && kill -9 $P; echo DONE"),
        ("停止 Squid", "systemctl stop squid 2>/dev/null; squid -k shutdown 2>/dev/null; echo DONE"),
        ("删除文件分发目录", "rm -rf /data/downloads /tmp/proxyopt_scripts; echo DONE"),
        ("清理 systemd 状态", "systemctl daemon-reload 2>/dev/null; echo DONE"),
    ]
    try:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/windows_migration/cleanup_environment.py (reported line 140)May include surrounding context.

python
("停止 gost 服务", "systemctl stop gost-proxyopt 2>/dev/null; systemctl disable gost-proxyopt 2>/dev/null; echo DONE"),
        ("停止 HTTP 8080 文件服务", "P=$(ss -tlnp | grep ':8080 ' | grep -oP 'pid=\\K[0-9]+' | sort -u); [ -n \"$P\" ] && kill -9 $P; echo DONE"),
        ("停止 Squid", "systemctl stop squid 2>/dev/null; squid -k shutdown 2>/dev/null; echo DONE"),
        ("删除文件分发目录", "rm -rf /data/downloads /tmp/proxyopt_scripts; echo DONE"),
        ("清理 systemd 状态", "systemctl daemon-reload 2>/dev/null; echo DONE"),
    ]
    try:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

The command recursively deletes all of /data/downloads without checking a migration ownership marker or restricting deletion to files created by this run. The fixed pathname is not shell injection, but on a reused proxy it can contain unrelated data that the broad cleanup confirmation does not identify.

Content

Scanner excerpt · scripts/windows_migration/cleanup_environment.py (reported line 140)May include surrounding context.

python
("停止 gost 服务", "systemctl stop gost-proxyopt 2>/dev/null; systemctl disable gost-proxyopt 2>/dev/null; echo DONE"),
        ("停止 HTTP 8080 文件服务", "P=$(ss -tlnp | grep ':8080 ' | grep -oP 'pid=\\K[0-9]+' | sort -u); [ -n \"$P\" ] && kill -9 $P; echo DONE"),
        ("停止 Squid", "systemctl stop squid 2>/dev/null; squid -k shutdown 2>/dev/null; echo DONE"),
        ("删除文件分发目录", "rm -rf /data/downloads /tmp/proxyopt_scripts; echo DONE"),
        ("清理 systemd 状态", "systemctl daemon-reload 2>/dev/null; echo DONE"),
    ]
    try:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/windows_migration/cleanup_windows.py (reported line 52)May include surrounding context.

python
commands = [
        ("删除计划任务 ConfigureSMSAgent",
         'schtasks /delete /tn ConfigureSMSAgent /f 2>nul & echo DONE'),

        ("删除计划任务 ConfigureSMSAgentPy2",
         'schtasks /delete /tn ConfigureSMSAgentPy2 /f 2>nul & echo DONE'),

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/windows_migration/cleanup_windows.py (reported line 55)May include surrounding context.

python
'schtasks /delete /tn ConfigureSMSAgent /f 2>nul & echo DONE'),

        ("删除计划任务 ConfigureSMSAgentPy2",
         'schtasks /delete /tn ConfigureSMSAgentPy2 /f 2>nul & echo DONE'),

        ("删除计划任务 SMSAgentWatchdog",
         'schtasks /delete /tn SMSAgentWatchdog /f 2>nul & echo DONE'),

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/windows_migration/cleanup_windows.py (reported line 58)May include surrounding context.

python
'schtasks /delete /tn ConfigureSMSAgentPy2 /f 2>nul & echo DONE'),

        ("删除计划任务 SMSAgentWatchdog",
         'schtasks /delete /tn SMSAgentWatchdog /f 2>nul & echo DONE'),

        (f"终止 SMS-Agent 进程 ({agent_exe_name})",
         f'taskkill /f /im {agent_exe_name} 2>nul & taskkill /f /im SmsAgent.exe 2>nul & taskkill /f /im SMSAgentDeploy.exe 2>nul & echo DONE'),

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/windows_migration/phases/configure_phase.py (reported line 194)May include surrounding context.

python
exe.run_ps(ps_write_cb, timeout=15)

                exe.run_ps(f"Remove-Item '{done_marker}' -Force -ErrorAction SilentlyContinue")
                exe.run_cmd("schtasks /delete /tn CompileAU3 /f")
                exe.run_cmd(
                    f'schtasks /create /tn CompileAU3 /tr "{compile_bat_remote}" '
                    f'/sc once /st 00:00 /f /rl highest'

Migration cleanup forcibly terminates all command shells in session 1.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The cleanup forcibly terminates every cmd.exe in session 1, without checking whether it belongs to the migration. On a production migration source, this can interrupt unrelated administrative scripts and applications, causing service disruption or lost work.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/windows_migration/core/executor/local_executor.py (reported line 31)May include surrounding context.

python
hlib import Path

from core.interfaces.executor import CommandResult, IRemoteExecutor

logger = logging.getLogger(__name__)


class LocalExecutor(IRemoteExecutor):
    """本地 Linux 执行器 — 在沙箱上执行命令和文件操作。"""

    def __init__(self, work_dir: str = ""):
        self._work_dir = work_dir

    def is_connected(self) -> bool:
        return True  # 本地总是连接

    def run_cmd(self, command: str, timeout: int = 300) -> CommandResult:
        """执行 shell 命令。"""
        start = time.time()
        try:
            proc = subprocess.run(
                command,
                shell=True,
                capture_output=True,
                text=True,
                timeout=timeout,
                cwd=self._work_dir or None,
            )
            return CommandResult(
                success=proc.returncode == 0,
                stdout=proc.stdout,
                stderr=proc.stderr,
                exit_code=proc.returncode,
                duration=time.time() - start,
            )
        except subprocess.Timeout

Routine file transfer automatically adds a persistent Windows Defender directory exclusion.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Ordinary file transfer automatically adds a directory-wide Defender exclusion, with no explicit approval or corresponding removal in this source. This leaves a persistent scanning blind spot that an attacker able to write into the excluded directory could exploit, especially because migration files include executables and scripts.

Content

No source excerpt is available for this finding.

Proxy setup terminates unrelated gost forwarding processes, not just this migration's forwards.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The pkill expression selects any accessible gost process whose command line contains -L, not just forwards created by this migration. On a shared jump host, setup can therefore interrupt unrelated tunnels and other migrations before attempting to start its own forwards.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/windows_migration/core/sms_client.py (reported line 66)May include surrounding context.

python
else:
                cmd.append(f"--{k}={v}")

        env = dict(os.environ)
        env["HWCLOUD_ACCESS_KEY"] = self.ak
        env["HWCLOUD_SECRET_KEY"] = self.sk

Non-owned EIPs advertised as unmodified reuse are subsequently modified through association.

High
Category
Excessive Agency
Confidence
98% confidence
Finding

The provider automatically selects an unbound EIP belonging to another owner, and prepare() subsequently associates it with the migration server through bind_eip(). An unbound address may still be reserved for another workload or referenced by DNS and allowlists, so this can redirect trusted traffic or disrupt another service despite the claim of unmodified reuse.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/windows_migration/phases/configure_phase.py (reported line 267)May include surrounding context.

python
task_name = "ConfigureSMSAgent"

        # 先删除已有任务
        exe.run_cmd(f'schtasks /delete /tn {task_name} /f', timeout=30)

        # 清旧日志
        exe.run_cmd(f'del "{log_path}" 2>nul', timeout=10)

Migration cleanup forcibly terminates unrelated command shells and their process trees across the source host.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Cleanup forcibly terminates every accessible cmd.exe and conhost.exe process and their descendants, without identifying migration-owned processes. On a live migration source, this can interrupt unrelated production jobs, administrative sessions, and application processes, potentially causing downtime or data loss.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/windows_migration/phases/configure_py2_phase.py (reported line 480)May include surrounding context.

python
# Create scheduled task: run every 3 minutes, highest privilege
        wd_task = _WATCHDOG_TASK
        exe.run_cmd(f'schtasks /delete /tn {wd_task} /f', timeout=15)
        r = exe.run_cmd(
            f'powershell -Command "'
            f'$action = New-ScheduledTaskAction -Execute \'powershell.exe\' '