Back to skill

Security audit

Alibabacloud Pai Eas Service Deploy

Security checks for vulnerabilities and agentic risk

Overview

This skill is aimed at Alibaba Cloud model deployment, but it needs Review because it can automatically create billable cloud services, alter local CLI state, and expose service access tokens.

Review before installing. Use a least-privilege RAM role, confirm region, instance type, networking, and expected cost before service creation, avoid running the curl-to-bash installer, pin or manually approve CLI/plugin versions, do not leave auto-plugin-install enabled, redact AccessToken from chat/log output, and prefer HTTPS or another protected channel for token-bearing invocation examples.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (4)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:105
Finding

Unverified Remote Installer Is Executed Directly by Bash

Content
View full analysis
= 3.3.3 (required baseline), then verify. curl -fsSL https://aliyuncli.alicdn.com/install.sh | bash aliyun version # must report >= 3.3.3; re-run install.sh to upgrade if lower ``` ### Technical Analysis The Skill downloads a mutable shell script and pipes it directly into Bash. The downloaded content is not pinned to a reviewed version and is not verified using a cryptographic checksum or digital signature before execution. HTTPS protects the connection in transit, but it does not protect against compromise of the CDN, DNS infrastructure, publishing account, remote web server, or upstream release process. It also does not ensure that the script executed later is the same script reviewed during this audit. This installation behavior is not the minimum privilege necessary to deploy a PAI-EAS service. The repository's installation guide already documents package-manager and separately downloaded binary alternatives, which allow verification before execution. ### Attack Path 1. An attacker compromises the installer hosting infrastructure, CDN, publishing credentials, or an upstream deployment process. 2. The attacker replaces `install.sh` with a malicious shell payload. 3. The Skill reaches its mandatory pre-check and executes the documented command. 4. `curl` retrieves the attacker-controlled response. 5. Bash immediately executes the response without inspection or integrity verification. 6. The payload runs with all permissions of the Agent process and may access local files, CLI credentials, environment variables, and authenticated cloud tooling. ### Impact Assessment Successful exploitation provides arbitrary command execution under the operating-system identity running the Skill. Depending on that identity and its c ...[truncated 612 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
SKILL.md:112
Finding

Forced Unpinned Plugin Updates and Persistent Automatic Installation

Content
View full analysis
/dev/null | grep -E "aiworkspace|eas" ``` ### Technical Analysis The Skill mandates updating and force-installing the `aiworkspace` and `eas` plugins without pinning reviewed versions or verifying package signatures or checksums. It also enables automatic plugin installation in the persistent Aliyun CLI configuration. The use of `--force` can overwrite an existing reviewed installation, while `plugin update` can introduce behavior that was not present during the Skill audit. Enabling `--auto-plugin-install` expands the future supply-chain trust boundary beyond the current deployment and is not restored to its previous value after the operation. Although the plugins support the declared deployment functionality, updating them automatically and leaving automatic installation enabled exceeds the minimum change required. A safer design would verify already installed versions and install only a specifically approved, integrity-checked release when necessary. ### Attack Path 1. An attacker compromises the plugin repository, release account, distribution infrastructure, or a plugin publishing process. 2. A malicious or modified plugin is published under a name the Skill installs. 3. The Skill runs `plugin update` or `plugin install ... --force`. 4. The unpinned malicious plugin replaces or supplements the local plugin. 5. A subsequent `aliyun aiworkspace` or `aliyun eas` command loads and executes the compromised component. 6 ...[truncated 993 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:442
Finding

Live Service Access Token Is Required to Be Copied into Agent Output

Content
View full analysis
--cluster-id \ --service-name --user-agent AlibabaCloud-Agent-Skills/alibabacloud-pai-eas-service-deploy | \ jq '{AccessToken, Endpoints: [.Endpoints[] | { Type: .EndpointType, Port: .Port, InternetEndpoints: .InternetEndpoints, IntranetEndpoints: .IntranetEndpoints }]}' ``` ```text Copy the ENTIRE output into your final response. ``` ```text Service Invocation Examples: curl /api/predict/ \ -H "Authorization: " curl /api/predict/ \ -H "Authorization: " curl :/api/predict/ \ -H "Authorization: " ``` ```text Always include a service invocation example using the AccessToken and endpoint URL. ``` ### Technical Analysis The endpoint query deliberately retains the `AccessToken` field, and the Skill explicitly instructs the Agent to copy the entire result into its final response and embed the token in invocation commands. A service access token is a bearer credential. Anyone obtaining it may invoke the associated service without proving a separate identity. Agent responses can be retained in conversation history, execution traces, observability systems, API logs, support records, browser history, or copied reports. Consequently, final response text is not an appropriate secret-delivery channel by default. Retrieving endpoint metadata is necessary for the declared deployment workflow. Disclosing the live token in the final response is not necessary; a placeholder or secure retrieval instruction is sufficient. ### Attack Path 1. The Skill calls `describe-service-endpoints`. 2. The command returns endpoint metadata and a ...[truncated 1128 chars]
Remediation
View remediation
` or an environment-variable reference in all generated examples: ```bash curl "https:///api/predict/" \ -H "Authorization: Bearer ${EAS_ACCESS_TOKEN}" ``` 3. Never instruct the Agent to copy complete secret-bearing API responses into its final answer. 4. If a user explicitly requests the credential, display a warning and use an approved secret-management or one-time secure delivery channel. 5. Prevent command tracing, debug logs, and shell history from recording token values. 6. Apply short token lifetimes and narrow service scope where supported. 7. Rotate any token already exposed in Agent responses or logs, and remove historical copies where operationally possible. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
references/service-invoke-examples.md:8
Finding

Bearer Credentials Are Sent to Inference Endpoints over Plaintext HTTP

Content
View full analysis
` header | ``` ```python from openai import OpenAI # Service endpoint base_url = "http://my-service.cn-hangzhou.pai-eas.aliyuncs.com/api/predict/my_service/v1" client = OpenAI( base_url=base_url, api_key="your-token" # Optional ) ``` The verification guide provides an even more direct token-bearing example: ```bash curl "http:///api/predict/" \ -H "Content-Type: application/json" \ -H "Authorization: " \ -d '{"input": "test"}' ``` ### Technical Analysis The documentation repeatedly constructs inference URLs with the `http://` scheme while placing bearer credentials in an `Authorization` header or OpenAI SDK `api_key` field. HTTP does not provide transport encryption, endpoint authentication, or integrity protection. A bearer credential intercepted in transit can be replayed directly. Public endpoints can traverse multiple netw ...[truncated 1691 chars]
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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (41)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This is a material description-behavior mismatch. The declared purpose centers on deploying AI models and creating PAI-EAS inference services. However, the supplied code only performs discovery of official images via aliyun aiworkspace list-images, then parses and prints the results. There is no service creation, model deployment, inference endpoint provisioning, or lifecycle management. The code's actual purpose is image catalog querying/supporting selection, which may be related to deployment workflows but is not itself deployment. The user-agent/session-id and dependency checks are supporting details, not mismatches.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents this skill as a model deployment capability for PAI-EAS inference services. However, the supplied code chunk is a standalone shell validator/fixer for service configuration JSON. It does not call deployment APIs, create services, launch model servers, or perform any model-specific actions for Qwen, Llama, SD, SDXL, speech synthesis, vLLM, SGLang, or ComfyUI. Its primary purpose is materially narrower and different: validating config structure and applying defaults. Writing an output file is consistent with validation tooling but is not described in the deployment-focused purpose. Therefore this is a clear description-versus-behavior mismatch.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
99% confidence
Finding

Fetching and executing a remote install script directly from the network introduces a classic supply-chain risk. If the upstream server, transport, or content is compromised, arbitrary code will run on the host with the agent's privileges before any validation occurs.

Content

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

bash
# Install or upgrade Aliyun CLI to >= 3.3.3 (required baseline), then verify.
curl -fsSL https://aliyuncli.alicdn.com/install.sh | bash
aliyun version   # must report >= 3.3.3; re-run install.sh to upgrade if lower

# Generate the per-session trace id once (see Observability section) and build

Chaining Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

Piping curl output straight to bash eliminates any opportunity to inspect or verify downloaded content and turns a network fetch into immediate code execution. In an adversarial or compromised environment, this enables arbitrary host compromise with a single modified response.

Content

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

bash
# Install or upgrade Aliyun CLI to >= 3.3.3 (required baseline), then verify.
curl -fsSL https://aliyuncli.alicdn.com/install.sh | bash
aliyun version   # must report >= 3.3.3; re-run install.sh to upgrade if lower

# Generate the per-session trace id once (see Observability section) and build

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs copying the full describe-service-endpoints output, including AccessToken, into the final response. Exposing live service credentials in chat/output can leak secrets to logs, downstream systems, or unauthorized viewers, enabling direct invocation of the deployed service.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| [Workflow](references/deployment-workflow.md) | Overview — Full deployment flow |

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

The explicit mention of password or access token in a configuration example promotes placement of high-value credentials directly in plaintext configuration. Even though the mount type is marked unsupported, the skill is a deployment reference and users may still reuse the pattern elsewhere, increasing the risk of credential exposure and unauthorized repository access.

Content

Scanner excerpt · references/storage-mount.md (reported line 268)May include surrounding context.

md
"branch": "master",
      "commit": "xxx",
      "username": "username",
      "password": "password or access token"
    }
  }]
}

Undeclared Tool Scope

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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
89% confidence
Finding

The instruction to proceed autonomously, choose defaults, and avoid asking the user increases the chance of unintended cloud changes. In this context, autonomy is more dangerous because the skill can create billable services and mutate local/cloud configuration without a human checkpoint.

Content

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

md
NOT completing the task. You MUST run create-service (Step 6) then
describe-service (Step 7). If resources were found, deploy them.

**4. Autonomous Execution** — Do NOT ask user for info discoverable
via APIs. Do NOT ask "should I proceed?" Execute directly.
Timeout? Retry with `--read-timeout 60`. Error? Inform user and CONTINUE.
Missing param? Pick reasonable default.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly directs autonomous execution of cloud service creation without a user-facing warning or confirmation about resource creation and billing. In a cloud deployment context, this can lead to unintended spend and unauthorized infrastructure changes if triggered with broad credentials.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The pre-checks direct installation and configuration changes on the local system without an explicit warning or opt-in. Silent host modification is dangerous because users may expect only remote cloud actions, not local changes affecting their environment and future CLI behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill installs or upgrades software and plugins on the host, expanding its reach from cloud deployment into local system modification. This creates supply-chain and integrity risk, particularly because the installation is automatic and not clearly constrained to an isolated environment.

Content

No source excerpt is available for this finding.

Scope Creep

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill modifies global Aliyun CLI state (aliyun configure set --auto-plugin-install true) on the host, which affects future commands outside this skill's run. Persistent configuration changes broaden impact beyond the immediate deployment task and can weaken operator control over plugin installation behavior.

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 · references/acceptance-criteria.md (reported line 317)May include surrounding context.

  • Gateway ID (if using dedicated gateway)
  • VPC/VSwitch/Security group (if using ALB/NLB)

❌ Wrong: Using default values without confirmation

bash
# Wrong: Using default region without asking user

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 · references/acceptance-criteria.md (reported line 320)May include surrounding context.

❌ Wrong: Using default values without confirmation

bash
# Wrong: Using default region without asking user
aliyun eas create-service --region cn-hangzhou ...

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This guide materially expands the skill’s operational scope from PAI-EAS model deployment into broad Alibaba Cloud administration, including ECS, RAM, VPC, RDS, profile management, plugin installation, and general credential handling. In an agent skill context, bundling general-purpose cloud CLI administration increases the chance an agent can be steered into unnecessary or overbroad cloud actions beyond intended model-serving tasks.

Content

No source excerpt is available for this finding.

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 40)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 55)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 68)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 81)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
97% confidence
Finding

The examples show passing access keys and secrets directly on the command line, which can leak via shell history, process listings, CI logs, terminal recording, or agent traces. In an automation/agent setting, this is especially risky because commands and arguments are often captured verbatim in logs or telemetry.

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 128)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 guide recommends debug logging without warning that debug output can expose signed requests, headers, endpoint details, profile selection, and other credential-adjacent information. In shared terminals, CI systems, or agent execution logs, this can unintentionally disclose sensitive operational data.

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

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

Troubleshooting

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The section title says this pattern performs an 'auto-switch from CPU when user requests CPU', which implies adaptive behavior based on user input. However, the JSON only specifies a fixed GPU vLLM image and a fixed GPU instance type, and there is no mechanism shown for detecting a CPU request or switching configurations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.