Back to skill

Security audit

Alibaba Cloud Compute ECS

Security checks for vulnerabilities and agentic risk

Overview

This ECS management skill fits its stated cloud-management purpose, but it needs review because it includes remote command execution and destructive cloud operations without strong safeguards.

Install only if you intend to let the agent help administer Alibaba Cloud ECS. Use a narrowly scoped RAM role, avoid broad delete or RunCommand permissions unless needed, review every target instance and command before execution, and treat saved inventory or command-output files as sensitive.

Vulnerability Patterns
  • 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
  • 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 (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:66
Finding

Unpinned Third-Party Python Dependencies

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 66 and 116
Vulnerability Type: Unpinned runtime dependencies
Risk Level: Medium

Vulnerable Code

At line 66:

bash
python -m pip install alibabacloud_ecs20140526 alibabacloud_tea_openapi alibabacloud_credentials

At line 116:

bash
python -m pip install alibabacloud_ecs20140526 alibabacloud_cms20190101 alibabacloud_tea_openapi alibabacloud_credentials

Technical Analysis

The documented installation commands retrieve third-party packages from the active pip package index without exact version constraints or integrity hashes. Consequently, the installed code can change over time without any corresponding change to the reviewed Skill.

Python package installation may execute package-controlled build logic, while imported dependencies execute with the privileges of the user running the Skill. These dependencies operate in a process that can access Alibaba Cloud credential environment variables and make authenticated cloud API requests. A compromised dependency release, compromised package index, or unsafe index configuration could therefore introduce behavior absent from the audited repository.

The package names appear consistent with the declared Alibaba Cloud functionality; the issue is the absence of reproducible version and integrity controls, not evidence that the named packages are currently malicious.

Attack Path

  1. An attacker compromises an upstream dependency release, its publication credentials, or a package source used by the operator.
  2. The operator follows one of the unpinned pip install commands from SKILL.md.
  3. pip resolves and installs the attacker-controlled or unexpectedly changed release.
  4. Malicious code executes during package installation or when an affected module is imported by a Skill script.
  5. The code accesses credentials available to the process or issues authenticated requests using the ...[truncated 840 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every direct dependency to an explicitly reviewed version.
  2. Generate a lock file that includes all transitive dependencies.
  3. Record and verify package hashes, and install with pip's --require-hashes option.
  4. Use an explicitly configured, trusted package index rather than inheriting an unknown global pip configuration.
  5. Download and review dependency artifacts before promoting them into an internal package repository.
  6. Run dependency installation in an isolated virtual environment without cloud credentials present.
  7. Separate installation from operational execution so build steps cannot access Alibaba Cloud credentials.
  8. Prefer short-lived role credentials and narrowly scoped RAM policies when running the scripts.
  9. Establish a controlled process for reviewing, testing, and updating pinned dependencies.
  10. Add automated dependency vulnerability and provenance checks to the Skill's validation workflow.

Example hardened workflow:

bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --require-hashes -r requirements.lock

The requirements.lock file should contain exact versions and approved SHA-256 hashes for direct and transitive packages.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (24)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill documents capabilities that rely on reading credentials from environment variables and writing artifacts to disk, but it does not declare any explicit tool scope or permission boundaries. That increases the chance an agent can access secrets or persist sensitive cloud inventory/results without clear authorization controls, creating avoidable credential exposure and data handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill provides a concrete workflow for running remote shell commands on ECS instances via Cloud Assistant, including an example command, but it does not warn that this executes code on production systems and can change state, affect availability, or expose sensitive process data. In an agent setting, this omission makes unsafe execution more likely because the action is presented as a normal troubleshooting step without requiring explicit confirmation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The operation mapping includes destructive and high-impact actions such as deleting instances, replacing or resetting disks, deleting snapshots/images, and changing security groups, but it does not include warnings about irreversible data loss, downtime, or network exposure. In a cloud-management skill, presenting these actions without safeguards materially increases the risk of accidental destructive operations by an agent or user.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file enumerates operations such as deleting instances, disks, snapshots, and security groups, as well as running remote commands, but provides no warning that these actions can affect user data, system integrity, or execute commands on hosts. For markdown files, SQP-2 applies when the skill description omits warnings about behaviors that could impact user data or systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The reference explicitly documents use of Cloud Assistant to execute shell or PowerShell scripts on ECS instances, but the skill metadata does not surface this high-risk capability as a user-facing warning. Omitting that warning can mislead users about the operational and security sensitivity of the skill, increasing the chance of unintended remote command execution on production instances.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation states that insufficient RAM permissions cause the API to return an empty list, which can mislead users and downstream agents into treating authorization failures as legitimate 'no resources found' results. In an infrastructure-management skill, this can cause incorrect automation decisions, mask access-control problems, and undermine troubleshooting or audit workflows.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file lists destructive disk actions such as ReplaceSystemDisk, ResetDisk, ReInitDisk, and DeleteDisk without any warning that they can cause irreversible data loss, service disruption, or rollback to an earlier state. In an operational cloud-management skill, omission of these cautions can lead users or downstream agents to invoke high-risk APIs too casually, increasing the chance of accidental destructive actions in production.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation explicitly lists destructive ECS actions such as stopping, rebooting, and deleting instances without any caution about service disruption, data loss risk, or the need for confirmation and scope validation. In an agent skill intended for infrastructure management, this can increase the likelihood of unsafe automation or operator error that causes outages or unintended resource deletion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file describes create, delete, modify, authorize, and revoke security group actions, which can affect system integrity and connectivity. The description provides no cautionary note about disruptive or destructive effects, so users are not warned about the operational risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The markdown enumerates DeleteSnapshot as a common operation but provides no warning that deleting snapshots can permanently remove recovery points and affect data protection. For markdown files, safety-relevant behaviors that may affect user data should be accompanied by an explicit warning.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/sources.md (reported line 1)May include surrounding context.

md
- OpenAPI product page: `https://api.aliyun.com/product/Ecs`
- API list (metadata): `https://api.aliyun.com/meta/v1/products/Ecs/versions/2014-05-26/api-docs.json`
- API overview: `https://www.alibabacloud.com/help/en/ecs/developer-reference/api-ecs-2014-05-26-overview`
- Endpoints: `https://www.alibabacloud.com/help/en/ecs/developer-reference/endpoints`

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/sources.md (reported line 2)May include surrounding context.

md
- OpenAPI product page: `https://api.aliyun.com/product/Ecs`
- API list (metadata): `https://api.aliyun.com/meta/v1/products/Ecs/versions/2014-05-26/api-docs.json`
- API overview: `https://www.alibabacloud.com/help/en/ecs/developer-reference/api-ecs-2014-05-26-overview`
- Endpoints: `https://www.alibabacloud.com/help/en/ecs/developer-reference/endpoints`

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script submits arbitrary shell or PowerShell commands to a remote ECS instance via RunCommand, which is a safety-critical operation. While the module docstring describes the utility at a high level, there is no confirmation prompt, cautionary comment, or explicit warning to the user about executing commands on a remote machine.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script reads cloud access key, secret, and optional security token from environment variables to authenticate API calls, but it provides no confirmation prompt, user-facing log message, or warning comment/docstring about this sensitive credential usage. For code files, access to sensitive environment variables should have some visible disclosure unless clearly warned elsewhere.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script enumerates all ECS regions and then queries instances in each region, which transmits account inventory metadata to the cloud API. There is no confirmation prompt, user-facing log/print, or warning comment/docstring explaining that it will perform account-wide network calls across regions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script reads cloud access key, secret, and optional security token from environment variables to authenticate API calls, but there is no confirmation prompt, logging, or explanatory comment beyond the generic module docstring. For a code file, access to sensitive credentials should have some visible disclosure unless clearly documented as part of the skill's stated purpose, which this file does not do explicitly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The markdown lists create, delete, attach, detach, and modify ENI operations, which can affect network connectivity and system integrity, but it provides no warning about potential disruption or the need for care. For markdown files, SQP-2 applies when descriptions omit warnings about behaviors that could affect user data, privacy, or system integrity.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file is primarily composed of English-language reference links, but line L12 points to an Indonesian-language help page (/help/id/). Forcing or mixing a different locale without user opt-in can create a language/locale policy issue, especially when the rest of the references are in English.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The script can write a full cross-region ECS instance inventory, including instance names and network identifiers, to a user-specified file. Although file output is an expected feature here, there is no confirmation prompt, visible warning, or user-facing notice near the write path that potentially sensitive inventory data will be persisted to disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The code reads access key, secret key, and optional security token values from environment variables to authenticate to Alibaba Cloud. Access to sensitive credentials is safety-relevant, but the script does not include any user-facing notice, comment, or warning that it will consume these credential variables.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

When --output is provided, the script writes the full result payload, including the executed command and decoded stdout/stderr-related data, to a local file. This is a file write involving potentially sensitive operational data, yet there is no warning or explanatory note about what will be stored.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

When --output is provided, the script writes results to a user-specified file path, but there is no confirmation, log message, or warning comment/docstring indicating that a file will be created or overwritten. File writes are in scope for missing user warnings in code files when no visible disclosure is present.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The script supports writing collected ECS inventory data to a user-specified file via --output, but there is no confirmation prompt, log message, or explanatory comment/docstring warning that a file will be created or overwritten. For code files, file-write operations should have some visible disclosure unless clearly warned elsewhere.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This code file performs a file write when --output is provided, but the only disclosure is the generic help text Write output to file, which does not explain that discovered VPC IDs and instance counts will be saved to disk. There is no confirmation prompt, user-facing log, or stronger warning near the write path.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.