Back to skill

Security audit

huawei-cloud-ecs-dsh-deploy

Security checks for vulnerabilities and agentic risk

Overview

This deployment skill needs review because failure cleanup can delete the wrong server and its network isolation promises do not match the code.

Fix rollback to use the exact created server ID and correct the proxy binding and security-group validation before using production resources. Use temporary credentials scoped to an isolated cloud project, keep TLS verification enabled, and avoid placing passwords in chat or logs. Avoid API-key pre-seeding until shell escaping and COC secret retention are addressed. Remote dependencies were not audited. The evidence supports Review for concrete safety defects, rather than a finding of intentional malicious behavior.

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/huawei_cloud_ecs.py
Finding

Automatic rollback discards the created instance ID and can delete an unrelated server

Content
View full analysis

Impact

Unconfirmed deletion of an unrelated ECS instance, causing service disruption and potential loss of instance data.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/coc_deploy.py
Finding

Wildcard reverse proxy exposes the supposedly loopback-only service beyond SSH access

Content
View full analysis

Impact

Unauthorized expansion of the agent application's network exposure and bypass of the promised SSH prerequisite. With permissive inherited ingress, the application becomes publicly reachable over HTTP.

Vulnerability Patterns
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (56)

Tainted flow: 'self.verify_ssl' from os.environ.get (line 39, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
98% confidence
Finding

Any HW_VERIFY_SSL value other than 'true' disables certificate verification for this GET request, and TLS warnings are globally suppressed. Although verification is enabled by default, disabling it lets an on-path attacker impersonate the cloud API, read sensitive responses or temporary security tokens, and manipulate deployment discovery results; this is not direct exfiltration of the secret access key.

Content

Scanner excerpt · scripts/huawei_cloud_ecs.py (reported line 76)May include surrounding context.

python
full_url = f"{request.schema}://{request.host}{request.resource_path}"

        if method == "GET":
            resp = requests.get(url=full_url, headers=request.header_params, verify=self.verify_ssl, timeout=timeout)
        elif method == "POST":
            resp = requests.post(url=full_url, headers=request.header_params, data=body_str, verify=self.verify_ssl, timeout=timeout)
        elif method == "PUT":

Tainted flow: 'self.verify_ssl' from os.environ.get (line 39, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
98% confidence
Finding

The environment-controlled verification flag can cause authenticated POST requests to accept an untrusted server certificate. With verification disabled, an on-path attacker can inspect request bodies and temporary security tokens or forge API responses, which is especially consequential for infrastructure-changing operations; request signing does not authenticate the server.

Content

Scanner excerpt · scripts/huawei_cloud_ecs.py (reported line 78)May include surrounding context.

python
if method == "GET":
            resp = requests.get(url=full_url, headers=request.header_params, verify=self.verify_ssl, timeout=timeout)
        elif method == "POST":
            resp = requests.post(url=full_url, headers=request.header_params, data=body_str, verify=self.verify_ssl, timeout=timeout)
        elif method == "PUT":
            resp = requests.put(url=full_url, headers=request.header_params, data=body_str, verify=self.verify_ssl, timeout=timeout)
        elif method == "DELETE":

Tainted flow: 'self.verify_ssl' from os.environ.get (line 39, credential/environment) → requests.put (network output)

Critical
Category
Data Flow
Confidence
97% confidence
Finding

If this PUT branch is used with HW_VERIFY_SSL set to anything other than 'true', the client does not verify the cloud server's certificate. An on-path attacker could then observe authenticated request contents or spoof responses, although the supplied code does not show a caller exercising this branch.

Content

Scanner excerpt · scripts/huawei_cloud_ecs.py (reported line 80)May include surrounding context.

python
elif method == "POST":
            resp = requests.post(url=full_url, headers=request.header_params, data=body_str, verify=self.verify_ssl, timeout=timeout)
        elif method == "PUT":
            resp = requests.put(url=full_url, headers=request.header_params, data=body_str, verify=self.verify_ssl, timeout=timeout)
        elif method == "DELETE":
            resp = requests.delete(url=full_url, headers=request.header_params, verify=self.verify_ssl, timeout=timeout)
        else:

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose covers creating and deploying an AI agent server, but the supplied command requests a destructive server-deletion operation. Deletion is a materially distinct capability that is not disclosed in the description. The script implementation is not supplied, so the deletion's exact effects cannot be verified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The primary deployment workflow matches the description, and networking configuration and COC execution are supporting implementation details. However, unrestricted standalone server deletion is an additional destructive capability not disclosed by the deployment-only description. The mandatory-confirmation claim is also not enforced: --auto-confirm proceeds without interactive approval, and security-group mutations occur before the prompt. An external caller could obtain prior approval, but this code does not verify that it did.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Deleting an existing instance is materially different from deploying one and is not merely a supporting deployment detail. Although the script implementation is not provided, the explicit --delete invocation exposes an undeclared destructive operation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Most functionality supports the declared deployment purpose, including network setup and readiness checks. However, delete_server adds a destructive capability not disclosed by the deployment description; it can target existing servers and accepts confirm=False. The description also explicitly requires confirmation before deployment, while create_server proceeds directly to provisioning and prepaid mode enables automatic payment. An external caller could implement confirmation, but that safeguard is not established by this code chunk. No unrelated third-party data transfer or materially different primary purpose is evident.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
84% confidence
Finding

The command's deployment purpose matches the description, but its unconditional execution does not implement the declared confirmation requirement for a charge-incurring operation. The script body is not supplied, so any internal confirmation or billing safeguards cannot be verified.

Content

No source excerpt is available for this finding.

The required deployment response exposes the server's SSH password in the conversation without warning about credential disclosure.

High
Category
Output Handling
Confidence
99% confidence
Finding

The required response prints the SSH password alongside the public IP and root login name, placing a privileged server credential into conversation history and potentially associated logs or exports. Anyone obtaining that transcript and network access to SSH could compromise the instance; the source-IP restriction reduces immediate exposure but does not make disclosure safe.

Content

No source excerpt is available for this finding.

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 · references/cli-installation-guide.md (reported line 16)May include surrounding context.

md
# If not installed, use package manager
# Ubuntu/Debian
sudo apt update && sudo apt install python3 python3-pip -y

# CentOS/RHEL
sudo yum install python3 python3-pip -y

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/deploy_dsh.py (reported line 655)May include surrounding context.

python
print(f"\n🔧 dsh Notes:")
                print(f"   - dsh web binds to 127.0.0.1:{dsh_port} only (by design)")
                print(f"   - Remote access goes through SSH tunnel (port 22 only, no public 80/3080)")
                print(f"   - Update CLI: sudo npm install -g @deepseek-ai/dsh && sudo systemctl restart dsh")
                print(f"   - View logs: journalctl -u dsh -f")
                sys.stdout.flush()

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% 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/coc_deploy.py (reported line 228)May include surrounding context.

python
# Remove conflicting default site if present
if [ -f /etc/nginx/sites-enabled/default ]; then
    rm -f /etc/nginx/sites-enabled/default
    echo "[$(date)] Removed conflicting default site"
fi

The deployment skill exposes deletion of arbitrary existing servers without checking that they belong to a dsh deployment.

High
Category
Excessive Agency
Confidence
90% confidence
Finding

The deletion path accepts any supplied server ID or name without a visible check that the target belongs to this deployment workflow. In an agent-accessible deployment tool using broad cloud credentials, mistaken or adversarial target selection could therefore delete unrelated infrastructure; this is a scope-control weakness, not a bypass of Huawei Cloud authorization.

Content

No source excerpt is available for this finding.

The deployment confirmation required by the manifest can be bypassed with --auto-confirm.

High
Category
Excessive Agency
Confidence
92% confidence
Finding

The --auto-confirm flag bypasses the script's only visible approval gate before creating paid cloud resources. Although an operator could supply this flag after obtaining approval elsewhere, the code does not enforce the skill's explicit requirement to confirm region, flavor, and billing mode with the user, making unauthorized expenditure possible in an agent workflow.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Shadow Command Trigger

Medium
Category
Trigger Abuse
Confidence
70% confidence
Finding

Shadow Command Trigger: 'Deploy dsh' conflicts with built-in command 'deploy'

Content

No source excerpt is available for this finding.

The standalone trigger “AI智能体” (AI agent) does not require deployment intent or a Huawei Cloud context.

Medium
Category
Trigger Abuse
Confidence
96% confidence
Finding

This trigger can match general questions about AI agents rather than requests to deploy DeepSeek Harness on Huawei Cloud. The trigger list provides no exclusion conditions to distinguish informational discussion from deployment requests.

Content

No source excerpt is available for this finding.

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

md
**Prohibited Actions:**
- ❌ Do NOT execute deployment before user explicitly confirms
- ❌ Do NOT use default config for deployment without asking user
- ❌ Do NOT assume user accepts default values
- ❌ **Do NOT fabricate or estimate prices** (e.g., "≈ ¥0.2-0.3/hour"); always refer users to the official pricing page

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

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

md
### 🔐 SSL/TLS Verification

- 🔒 **SSL/TLS certificate verification is enabled by default** for all Huawei Cloud API requests (`verify=true`).
- The `HW_VERIFY_SSL` environment variable can override this — `HW_VERIFY_SSL=false` disables verification.
- ⚠️ **`HW_VERIFY_SSL=false` is for testing only.** Never disable SSL verification in production; it exposes AK/SK credentials and API traffic to man-in-the-middle attacks.

## Core Commands and Usage