Back to skill

Security audit

Alibabacloud Ram Permission Diagnose

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for Alibaba Cloud permission diagnosis and repair, but it uses risky installer/update steps and recommends broad IAM-changing authority that users should review carefully.

Install only after reviewing the Aliyun CLI and plugin steps, avoiding curl-to-bash and blanket plugin auto-updates where possible. Use a tightly scoped diagnostic identity first, require explicit approval for every write repair, back up existing policies and trust documents before changes, and avoid granting AliyunRAMFullAccess unless a cloud administrator has accepted that account-wide IAM risk.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (5)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:21
Finding

Unverified Remote Installer Is Piped Directly into Bash

Content
View full analysis
= 3.3.3 required** > Run `aliyun version` to verify >= 3.3.3. If not installed or version too low, > run `curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash` to update, ``` ### Technical Analysis The installation instruction downloads a mutable shell script and immediately passes it to Bash. The retrieved content is not pinned to a reviewed version and is not checked using a cryptographic signature or published checksum before execution. HTTPS protects the connection in transit but does not establish that the current response is identical to the artifact reviewed during this audit. Compromise of the origin, CDN, DNS resolution, certificate infrastructure, or vendor publishing account could cause arbitrary shell commands to be returned and executed. The referenced hostname appears related to Alibaba Cloud, but source reputation does not eliminate the risks inherent in executing an unverified, mutable network response. ### Attack Path 1. The Skill is activated on a system without the required CLI version. 2. The agent or user follows the documented update instruction. 3. An attacker compromises or otherwise influences the remote script distribution channel. 4. `curl` retrieves the attacker-controlled response. 5. Bash executes the response immediately without inspection or integrity verification. 6. The payload runs with all operating-system privileges available to the invoking agent or user. ### Impact Assessment Successful exploitation provides arbitrary local command execution with the privileges of the invoking process. Depending on those privileges and the host configuration, this may permit: - Reading or modifying files accessible to the user. - Accessing locally configured cloud credentials. - Modifying CLI configuration or in ...[truncated 148 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
SKILL.md:26
Finding

Mandatory Automatic Plugin Installation and Unpinned Updates

Content
View full analysis
[MUST] run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation. > [MUST] run `aliyun plugin update` to ensure that any existing plugins are always up-to-date. ``` ### Technical Analysis The Skill requires automatic plugin installation and unconditional updates before diagnosis. No plugin allowlist, version pin, integrity hash, signature verification, or review step is specified. This creates a mutable supply-chain execution path: the effective plugin code may change after the Skill has been audited. Enabling automatic installation also changes persistent CLI configuration, potentially affecting unrelated Aliyun CLI activity after the Skill has finished. Automatic installation and blanket updating are broader than necessary for RAM permission diagnosis. The workflow should determine which specific plugin or CLI capability is required and install only that reviewed component. ### Attack Path 1. The Skill enables automatic plugin installation in persistent Aliyun CLI configuration. 2. The Skill invokes the global plugin update operation or later runs a command requiring a plugin. 3. The CLI resolves and downloads the current plugin release from its configured distribution source. 4. A compromised repository, publisher account, release, or dependency supplies malicious plugin code. 5. The CLI loads or executes the plugin under the current user’s privileges. 6. The malicious component can access local data and any cloud credentials available to the CLI process. ### Impact Assessment A compromised plugin can obtain local code execution with the invoking user’s privileges. It may also inherit access to configured Alibaba Cloud credentials and perform operations permitted to the ...[truncated 177 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/ram-cli-commands.md:15
Finding

Predictable Temporary File May Expose Diagnostic Data or Enable Symlink Attacks

Content
View full analysis
[params] > /tmp/.txt 2>&1 aliyun ram decode-diagnostic-message \ --encoded-diagnostic-message "$(grep -o 'EncodedDiagnosticMessage:[^ ]*' /tmp/.txt | cut -d: -f2)" ``` ``` ### Technical Analysis The workflow redirects the complete standard output and standard error of a cloud operation to a predictable path under the shared `/tmp` directory. It does not require exclusive creation, restrictive permissions, path validation, or cleanup. An attacker with local access may predict the pathname and create a symbolic link before the command runs. Shell redirection then follows that link using the permissions of the invoking user, potentially truncating or overwriting another accessible file. Depending on the system umask and local access controls, another user may also read the resulting file. The captured output can include an encoded diagnostic message, account or principal identifiers, resource identifiers, request metadata, and other operational details. The documentation also instructs the workflow to rerun the original failing command, which may repeat an operation whose side effects are not known. ### Attack Path 1. A local attacker predicts the context-derived path, such as `/tmp/aliyun_ecs_stopinstance.txt`. 2. The attacker creates a symbolic link at that path pointing to another file accessible to the victim. 3. The Skill reruns the original command and uses shell redirection on the predictable path. 4. The shell follows the symbolic link and truncates or overwrites the target file. 5. Alternatively, the attacker monitors or reads the temporary output if its permissi ...[truncated 544 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/ram-policies.md:30
Finding

Full RAM Administrative Access Is Recommended Beyond the Skill’s Minimum Requirements

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
references/ram-cli-commands.md:183
Finding

Role Trust Policy Repair Replaces the Entire Existing Trust Document

Content
View full analysis
# Note the AssumeRolePolicyDocument field # Step 2: Update trust policy (add caller ARN to Principal.RAM array) aliyun ram update-role \ --role-name \ --new-assume-role-policy-document '{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"RAM":["acs:ram:::root","acs:ram:::user/"]}}],"Version":"1"}' # Undo: restore original Principal by calling UpdateRole again with original JSON aliyun ram update-role \ --role-name \ --new-assume-role-policy-document '' ``` ``` ### Technical Analysis The `update-role` operation replaces the role’s complete assume-role policy document. Although the instructions first retrieve the current role, the update example does not merge the intended caller into that document. It instead submits a new template containing only one statement. Executing this template can remove existing statements, conditions, federated principals, service principals, external-ID restrictions, multi-factor authentication requirements, and other trust controls. It also inserts the account root principal without establishing that this broad trust relationship is necessary. The stated undo method depends on correctly preserving and re-submitting the entire original JSON. No atomic backup, concurrency check, validation, or rollback verification is required. ### Attack Path 1. A permission error is classified as a role trust-policy problem. 2. The Skill retrieves the current role but uses the documented template instead of structurally merging the required principal. 3. The user approves direct execution. 4. `update-role` replaces the complete t ...[truncated 911 chars]
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The skill instructs the agent/user to execute a remote installation script via curl ... | bash, which is a classic unsafe supply-chain pattern. It grants immediate shell execution to content fetched over the network without verification, so a compromised host, CDN, DNS path, or script update could lead to arbitrary code execution in the agent or user environment.

Content

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

md
**Pre-check: Aliyun CLI >= 3.3.3 required**
> Run `aliyun version` to verify >= 3.3.3. If not installed or version too low,
> run `curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash` to update,
> or see `references/cli-installation-guide.md` for installation instructions.

**Pre-check: Aliyun CLI plugin update required**

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description says to use the skill whenever an agent encounters 'any permission-related error' and to 'use this skill immediately' without waiting for an explicit request. It also expands scope to users describing permission issues, SDK coding issues, minimum-permission questions, and missing-permission inquiries, but provides no exclusion conditions or negative examples to bound when the skill should not activate.

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 instructs the skill to perform repair actions including attaching policies, creating custom policies, modifying trust policies, and creating service-linked roles. Those are safety-critical changes to permissions and system configuration, but the reference text does not include a user-facing warning or caution about their impact before proceeding.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The file directs providing modification commands for trust policies and a command to create a service-linked role. These operations affect identity and authorization state, yet the document does not warn users that executing them changes permissions and should be validated carefully.

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 documents actions such as stopping instances, deleting objects and buckets, modifying security settings, and granting full-control system policies, but it provides no warning that these operations can affect availability, data integrity, or access posture. Under the markdown-specific warning criterion, descriptions of potentially harmful behaviors should disclose user-data or system-impact risks.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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/hot-services-ram.md (reported line 85)May include surrounding context.

md
| Scenario | Required Actions | Resource Pattern |
|----------|-----------------|-----------------|
| Query instances | `slb:DescribeLoadBalancers`, `slb:DescribeLoadBalancerAttribute` | `acs:slb:*:*:loadbalancer/*` |
| Listener management | `slb:CreateLoadBalancerHTTPListener`, `slb:StartLoadBalancerListener` | `acs:slb:*:*:loadbalancer/*` |
| Backend servers | `slb:AddBackendServers`, `slb:RemoveBackendServers` | `acs:slb:*:*:loadbalancer/*` |

### Recommended System Policies

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file documents deletion of custom IAM policies and policy versions without an explicit warning that removing policies can immediately revoke access for dependent users, roles, or automation. In a permission-repair skill, operators may copy these commands during troubleshooting and accidentally cause outages or lockouts, especially because the surrounding content is highly action-oriented.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% 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 · references/ram-cli-commands.md (reported line 173)May include surrounding context.

aliyun ram delete-policy-version --policy-name --version-id v1

...repeat until only the default version remains

Then delete the policy (automatically removes the last version)

aliyun ram delete-policy --policy-name

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trust-policy repair section instructs users to add caller principals and attach assume-role permissions, which directly changes who can assume a role. Without a clear safety warning and least-privilege guidance, this can expand role access, enable unintended cross-principal assumption, and create privilege-escalation paths if applied broadly or to the wrong role.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The guidance instructs the agent to search using an English query pattern ('{product} RAM authorization site:help.aliyun.com') and prefers specific documentation sources, which implicitly fixes the language/locale of the skill's research behavior. There is no user opt-in, alternative locale handling, or justification that the skill is limited to English-only operation.

Content

No source excerpt is available for this finding.