Back to skill

Security audit

Alibabacloud Ecs Disaster Recovery Image

Security checks for vulnerabilities and agentic risk

Overview

The skill’s main disaster-recovery workflow is coherent, but its CLI installation and plugin-update instructions introduce review-worthy supply-chain and persistent configuration risk.

Review this skill before installing. Use a preinstalled, vendor-verified Aliyun CLI where possible, avoid curl-to-bash or unverified latest binary installation, do not enable persistent auto-plugin-install unless you intend it, and run the workflow only with a dedicated least-privilege RAM role because it can create billable ECS/VPC resources.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:30
Finding

Unverified Remote Installation Script Executed Directly by Bash

Content
View full analysis
2. If not installed: notify the user, and after user confirmation run `curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash`, or refer to [references/cli-installation-guide.md](references/cli-installation-guide.md) ``` ### Technical Analysis The instruction streams a mutable remote response directly into Bash. The payload is neither pinned to a specific version nor authenticated through a cryptographic signature or trusted checksum. HTTPS provides transport protection but does not establish that the current server response is the same content that was reviewed during this audit. User confirmation reduces the likelihood of unexpected execution but does not allow the user or agent to meaningfully inspect the payload before it runs. The downloaded script executes with all privileges available to the user running the agent and can access that user's files, environment, CLI configuration, and cloud credentials. The Aliyun CLI is necessary for the declared workflow, but executing an unverified remote shell script is not the minimum-risk installation method. ### Attack Path 1. An attacker compromises the installation origin, CDN, DNS resolution path, TLS endpoint, or release publication process. 2. The response for `https://aliyuncli.alicdn.com/setup.sh` is replaced with attacker-controlled shell commands. 3. The user confirms CLI installation based on the Skill's recommendation. 4. `curl` retrieves the modified response and pipes it directly to Bash without an intermediate verification step. 5. Bash executes the attacker-controlled commands with the invoking user's permissions. 6. The payload can read or alter local files, capture Alibaba Cloud credentials, modify command-line tools, or issue cloud requests through the authenticated environment. ### Impact ...[truncated 673 chars]
Remediation
View remediation
.tgz \ https:///aliyun-cli--linux-amd64.tgz ``` 4. Verify a vendor-published cryptographic signature. If signatures are unavailable, verify a SHA-256 digest obtained through an independently authenticated release manifest: ```bash printf '%s %s\n' '' 'aliyun-cli-.tgz' | sha256sum --check - ``` 5. Inspect archive paths before extraction and reject absolute paths, traversal entries, links, or unexpected files. 6. Prefer a trusted operating-system package manager or a reviewed, non-privileged user-local installation. 7. Require explicit user approval after displaying the pinned version, source, digest verification result, and destination path. ]]>

T08 · Insecure Dependencies

Error
Location
SKILL.md:34
Finding

Mandatory Unpinned Plugin Updates and Persistent Automatic Installation

Content
View full analysis
**[MUST] Pre-check: Aliyun CLI plugin update** > ```bash > aliyun configure set --auto-plugin-install true > aliyun plugin update ``` ### Technical Analysis The Skill mandates enabling automatic plugin installation and updating plugins before the disaster-recovery workflow. These operations retrieve mutable dependency content that is not part of the audited project and is not pinned to reviewed versions. Setting `--auto-plugin-install true` modifies CLI configuration and can persist after the Skill completes. Future commands may therefore install additional plugins automatically, extending the supply-chain trust boundary beyond this workflow. Running `aliyun plugin update` can also replace previously known-good plugin versions with whatever versions are current at execution time. The workflow only needs the ECS and VPC command functionality. Updating every installed plugin and enabling persistent automatic installation exceed the minimum changes necessary to perform that task. ### Attack Path 1. An attacker compromises the plugin repository, plugin publication account, release artifact, or dependency distribution path. 2. A malicious or altered plugin is published as an available update. 3. The Skill requires the user environment to enable automatic plugin installation. 4. The mandatory `aliyun plugin update` command downloads and installs the compromised release. 5. A subsequent authenticated `aliyun ecs` or `aliyun vpc` operation loads or invokes the altered component. 6. The component executes under the local user and can observe or modify cloud API operations performed with the active profile. 7. Because automatic installation remains enabled, later CLI activity may continue retrieving unreviewed components outside the Skill session. # ...[truncated 751 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
references/cli-installation-guide.md:41
Finding

Unverified Mutable CLI Binaries Installed into a System-Wide Executable Path

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Rogue AgentSelf-Modification, Session Persistence
Findings (14)

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The skill instructs fetching and executing a remote shell script via curl piped to bash, which is a classic supply-chain and arbitrary-code-execution risk. If the remote host, transport, or script content is compromised, the user would execute attacker-controlled code on their local machine with their current privileges.

Content

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

md
> **Pre-check: Aliyun CLI >= 3.3.3 required**
> 1. Run `aliyun version` to check whether the CLI is installed and verify the version
> 2. If not installed: notify the user, and after user confirmation run `curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash`, or refer to [references/cli-installation-guide.md](references/cli-installation-guide.md)
> 3. If installed but version < 3.3.3: report the current version and the minimum requirement, then upgrade after user confirmation
> 4. If installed and version >= 3.3.3: proceed to the next step

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The activation description says the skill also applies to phrases like "镜像备份", "制作镜像", and "从镜像创建实例", which are generic cloud operations rather than narrowly scoped disaster-recovery intents. Because the manifest does not provide exclusion conditions or negative examples, these broad phrases could cause unintended invocation for ordinary image-management tasks.

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 248)May include surrounding context.

text

- Target zone has a VSwitch with matching `ZoneId` -> use it directly
- Otherwise -> use `AskUserQuestion` with options `Create VSwitch (Recommended)` (include a suggested CIDR in the description) / `Pick another zone`. **Never create a VSwitch without confirmation.** After the user confirms:

```bash
aliyun vpc create-vswitch \

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

md
tar -xzf aliyun-cli-macosx-latest-amd64.tgz

# Move to PATH
sudo mv aliyun /usr/local/bin/

# Verify
aliyun version

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

md
tar -xzf aliyun-cli-macosx-latest-amd64.tgz

# Move to PATH
sudo mv aliyun /usr/local/bin/

# Verify
aliyun version

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

md
tar -xzf aliyun-cli-macosx-latest-amd64.tgz

# Move to PATH
sudo mv aliyun /usr/local/bin/

# Verify
aliyun version

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

Extract and install

tar -xzf aliyun-cli-linux-latest-arm64.tgz sudo mv aliyun /usr/local/bin/

text

### Windows

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The examples place access key IDs and secrets directly on the command line, which can leak through shell history, process listings, terminal logging, CI logs, and agent telemetry. In a skill intended for automation, this is more dangerous because users may copy these commands verbatim into scripts or shared execution environments, causing long-lived credential exposure.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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/cli-installation-guide.md (reported line 118)May include surrounding context.

md
1. Log in to Aliyun Console: https://ram.console.aliyun.com/
2. Navigate to: AccessKey Management
3. Create a new AccessKey pair
4. Save the secret immediately -- it's only shown once

### Configuration Modes

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The debugging guidance recommends --log-level=debug without warning that debug output can include request metadata, endpoints, headers, profile information, and potentially credential-adjacent details that aid compromise. In troubleshooting workflows, such logs are often pasted into tickets or chat, amplifying the risk of accidental disclosure.

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

bash
# Restrict permissions
chmod 600 ~/.aliyun/config.json

Troubleshooting

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The guide expands beyond the disaster-recovery image skill into broad plugin installation and service exploration, including examples for unrelated products such as VPC, RDS, and FC. In an agent skill context, this increases attack surface and makes it easier for downstream automation or users to enable capabilities outside the declared scope, which weakens least-privilege and scope control.

Content

No source excerpt is available for this finding.

Scope Creep

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented sanity-check uses aliyun ecs describe-regions, which requires an ECS permission that is not included in the stated least-privilege policy. This creates a documentation/policy mismatch: operators may see a permission failure before the workflow starts and then compensate by granting broader ECS access than necessary, undermining least privilege.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest description is written in Chinese and anchors invocation to Chinese trigger phrases, while the document does not state that the skill is intentionally limited to Chinese-speaking users or offer multilingual alternatives. This can violate language/locale policy when a skill implicitly constrains usage to one language without user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.