Back to skill

Security audit

Alibaba Cloud Compute ECS

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Alibaba Cloud ECS administration skill whose powerful cloud actions are disclosed and purpose-aligned, though users should apply least privilege and review remote commands carefully.

Install dependencies in an isolated environment, prefer pinned reviewed SDK versions, use short-lived least-privileged RAM credentials, and require human review before lifecycle changes, security group edits, disk/image operations, or RunCommand. Treat saved inventory and command-output JSON as sensitive because it may contain account structure, instance identifiers, or command stdout.

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 SDK Dependencies## Vulnerability Details **File Location**: `SKILL.md`, lines 66 and 116 **Vulnerability Type**: Unpinned third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```bash python -m pip install alibabacloud_ecs20140526 alibabacloud_tea_openapi alibabacloud_credentials ``` ```bash python -m pip install alibabacloud_ecs20140526 alibabacloud_cms20190101 alibabacloud_tea_openapi alibabacloud_credentials ``` ### Technical Analysis The installation instructions specify package names without exact versions or cryptographic hashes. Consequently, each installation resolves the package versions available from the configured Python package index at execution time rather than a set of previously reviewed artifacts. This creates a supply-chain exposure: if one of the named packages or a transitive dependency publishes a compromised release, that release could be installed automatically. Python packages may execute code during installation or when imported by the Skill scripts. The package names appear consistent with the declared Alibaba Cloud functionality, and the audit found no evidence that they are intentionally malicious or obtained from an unofficial source. The vulnerability is the lack of reproducible, integrity-verified dependency resolution. ### Attack Path 1. An attacker compromises an upstream package account, release process, distribution artifact, or transitive dependency. 2. The attacker publishes a malicious version under a dependency name used by the Skill. 3. A user follows the documented `pip install` command after the compromised version becomes available. 4. Pip resolves and installs the malicious release because no version or artifact hash is constrained. 5. Malicious code executes during installation or when an affected module is imported. 6. The payload can access the local process environment, including Alibaba Cloud credentials, and issue requests with the permissions of the configured cloud identity. ### Impact Assessment Suc ...[truncated 670 chars]
Remediation
## Remediation Suggestions 1. Pin every direct dependency to an exact, reviewed version, for example: ```text alibabacloud_ecs20140526==REVIEWED_VERSION alibabacloud_cms20190101==REVIEWED_VERSION alibabacloud_tea_openapi==REVIEWED_VERSION alibabacloud_credentials==REVIEWED_VERSION ``` 2. Generate and commit a lock file that also constrains transitive dependencies. 3. Require cryptographic hashes for resolved distributions, such as by using `pip install --require-hashes -r requirements.txt`. 4. Retrieve packages only from an explicitly configured, trusted package index or an organization-controlled artifact mirror. 5. Review dependency updates before changing the lock file, and use automated vulnerability and provenance scanning. 6. Continue installing dependencies in an isolated virtual environment and avoid running pip with elevated operating-system privileges. 7. Use short-lived Alibaba Cloud credentials and a least-privileged RAM role so that compromise of the Python environment has limited cloud impact.
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 (18)

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill documents use of environment variables for cloud credentials and directs writing artifacts under an output directory, but it does not declare any explicit tool scope or permission boundaries. In an agent setting, missing `permissions` or `allowed-tools` metadata can allow broader-than-intended access to environment secrets and filesystem writes, increasing the chance of credential exposure or unauthorized artifact creation.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill provides a ready-to-run remote command workflow (`RunCommand`) against ECS instances and even includes an execution example, but it does not prominently warn that this performs live actions on target systems. In a cloud administration skill, this materially increases risk because an agent or user may execute invasive commands on production instances without an explicit confirmation or impact notice, potentially causing service disruption, data exposure, or unintended system changes.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The document explicitly instructs users to execute shell or PowerShell scripts on ECS instances via Cloud Assistant, but it provides no warning about the security impact of remote command execution. In a skill intended to help operate cloud infrastructure, this omission can normalize highly sensitive actions and increase the chance of accidental destructive commands, unauthorized changes, or misuse on production systems.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This markdown file lists potentially disruptive infrastructure operations such as deleting security groups and changing rules, but provides no user-facing warning about the risk of breaking connectivity or exposing services. For markdown files, safety-affecting behaviors that impact system integrity should include an explicit warning.

External Transmission

Medium
Category
Data Exfiltration
Content
- 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`
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
- 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`
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
This code submits arbitrary command text from `--command` directly to Alibaba Cloud ECS RunCommand, which can perform destructive or irreversible actions on a remote instance. Although the module docstring describes the utility's purpose, there is no confirmation prompt or explicit safety warning near execution to disclose the impact of running remote shell commands.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
Line L18 points to an `/help/id/` URL, which directs users to Indonesian-language documentation, while the surrounding file is in English. This creates a language/locale constraint without offering user choice or explaining why a non-English locale is required.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The markdown lists create/delete and attach/detach network interface operations, which can affect system connectivity and availability, but it provides no warning about potential disruption or irreversible impact. Under the markdown-specific warning criterion, descriptions of operations affecting system integrity should disclose those risks.

Natural-Language Policy Violations

Low
Confidence
77% confidence
Finding
The file is primarily composed of English-language documentation links, but L12 points to an Indonesian-language (`/help/id/`) page without any explanation or user opt-in. If the organizational policy requires offering language choice rather than forcing a locale, this hardcoded locale mismatch could violate that requirement.

Missing User Warnings

Low
Confidence
82% confidence
Finding
The code accesses access key ID, secret, and optional security token from environment variables to authenticate API calls. While this is standard behavior, the script does not visibly warn users that it will consume local cloud credentials, and there is no user-facing log, help text, or comment highlighting that sensitive credentials are being used.

Missing User Warnings

Low
Confidence
86% confidence
Finding
The script can persist remote command output and the original command to disk via `--output`, and those results may contain sensitive system or user data retrieved from the remote instance. Although the argument name implies file output, there is no warning in help text or comments that sensitive contents may be written locally.

Context-Inappropriate Capability

Low
Confidence
81% confidence
Finding
The module docstring presents this script as summarizing ECS instance specs, but the implementation directly pulls access keys and security tokens from environment variables to authenticate API calls. While ECS access itself is expected for the skill, explicit credential harvesting from process environment is a broader capability not justified by the narrow documented purpose of a summarizer script.

Missing User Warnings

Low
Confidence
84% confidence
Finding
This code accesses sensitive Alibaba Cloud credential environment variables and uses them to authenticate API clients, but the file provides no user-facing warning, confirmation, or inline disclosure beyond the implementation itself. For code files, credential access is in scope when there is no visible notice explaining the behavior.

Missing User Warnings

Low
Confidence
80% confidence
Finding
The script calls cloud APIs to list regions and enumerate ECS instances across all regions, which transmits account inventory context to the provider endpoints. There is no confirmation prompt or user-facing warning in the file indicating that it will perform account-wide network queries.

Missing User Warnings

Low
Confidence
86% confidence
Finding
The script can write results to a user-specified file path, but there is no explicit warning that the file will be created or overwritten. For code files, file writes are in scope when there is no visible disclosure such as a warning in help text, logging, or comments.

Missing User Warnings

Low
Confidence
87% confidence
Finding
The code reads Alibaba Cloud access keys and security token from environment variables to authenticate API requests, but the file provides no user-facing notice, comment, or prompt explaining that sensitive credentials will be consumed. Under the code-file criteria, access to sensitive environment variables should have some visible disclosure unless clearly documented elsewhere.

Missing User Warnings

Low
Confidence
78% confidence
Finding
The code accepts a user-supplied --output path and overwrites that file directly with no prompt, warning message, or explanatory comment about the write behavior. Although file output is part of the script's function, the write is not disclosed to the user beyond the argument name itself, which may be insufficient as a safety warning under this rule.

Static analysis

No suspicious patterns detected.