Back to skill

Security audit

Alibabacloud Analyticdb Mysql Copilot

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent Alibaba Cloud diagnosis purpose, but its setup and runtime instructions create review-worthy risks around unverified installs, persistent cloud credentials, and forced authenticated API calls.

Install only after reviewing and replacing the unsafe setup steps: use a trusted package manager or pinned, verified Aliyun CLI release; avoid automatic plugin installation or unpinned updates; use least-privilege read-only RAM permissions; prefer temporary or role-based credentials; and do not paste cloud secrets into command lines or agent conversations. Expect this skill to make authenticated Alibaba Cloud API calls and to send diagnostic questions, cluster IDs, and region information to Alibaba Cloud endpoints.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (5)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:21
Finding

Unverified Remote Script Is Executed Directly by Bash

Content
View full analysis
**Pre-check: Aliyun CLI >= 3.3.3 required** > Run `aliyun version` to verify version >= 3.3.3. If not installed or version is too low, > run `curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash` to install/update, > or see `references/cli-installation-guide.md`. > Then [MUST] run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation. > [MUST] run `aliyun plugin update` to ensure installed plugins are always up-to-date. ``` ### Technical Analysis The installation procedure downloads a mutable script and passes it directly to Bash. The script is not saved for review, pinned to a version, checked against a cryptographic digest, or verified with a publisher signature. HTTPS protects the connection in transit but does not protect against compromise of the hosting infrastructure, publishing account, DNS/TLS environment, or upstream release process. Enabling automatic plugin installation and mandating unconditional plugin updates further expands the mutable execution surface. Future plugin content can execute after the Skill itself has already been reviewed. This behavior is not necessary for the declared cluster-query and diagnosis functionality when a suitable CLI is already present. Installation should be a separate, explicitly approved administrative operation. ### Attack Path 1. An attacker compromises the script host, release process, plugin repository, or another component of the delivery channel. 2. The remote `setup.sh` or a subsequently installed plugin is replaced with attacker-controlled code. 3. A user or Agent follows the mandatory pre-check instructions. 4. `curl` streams the current payload directly into Bash. 5. The payload executes with the local privileges of the Agent or use ...[truncated 549 chars]
Remediation
View remediation

T08 · Insecure Dependencies

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

Mutable “Latest” Binaries Are Installed into a System-Wide Executable Path Without Integrity Verification

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

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

Cloud Access Keys Are Placed in Command-Line Arguments

Content
View full analysis
\ --access-key-secret \ --region cn-hangzhou ``` Additional examples containing literal credential arguments appear at `references/cli-installation-guide.md:133-141`, `158-165`, and `173-181`. ### Technical Analysis Supplying an AccessKey ID and secret as command-line arguments can expose the credentials through shell history, process inspection, terminal recording, CI/CD logs, Agent transcripts, and command auditing systems. The guide explicitly describes this non-interactive method as recommended, increasing the likelihood that users will copy credentials directly into a shell command. These examples conflict with the security rules in `SKILL.md:30-35`, which prohibit use of literal credential values with `aliyun configure set`. The inconsistency makes it possible for users or Agents to follow the less secure referenced instructions. ### Attack Path 1. A user follows the installation guide and substitutes real credentials into the example. 2. The shell records the command in its history or an automation platform records it in logs. 3. During execution, the secret may also be visible in the process argument list. 4. Another local user, compromised process, support operator, or log reader retrieves the credential. 5. The attacker uses the exposed key to authenticate to Alibaba Cloud. 6. The attacker performs any operation permitted by the associated RAM identity. ### Impact Assessment The immediate impact is disclosure of Alibaba Cloud authentication material. The resulting cloud scope depends on the permissions assigned to the key. If a root account, full-access policy, or privileged RAM role is used, exp ...[truncated 181 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
references/cluster-diagnosis.md:13
Finding

User-Controlled Diagnostic Questions Are Embedded in Shell Commands Without Safe Argument Handling

Content
View full analysis
--endpoint --biz-region-id --query "" --user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-mysql-copilot ``` Related templates also appear in `SKILL.md:82-83`, `135-137`, and `249-256`. ### Technical Analysis The Skill requires natural-language user content to be placed in the `--query` argument but does not require direct process invocation, argument arrays, shell escaping, or input validation. Double quotes alone are insufficient if the supplied question contains a quote followed by shell metacharacters. If an Agent constructs a command string and executes it through a shell, specially crafted user input can terminate the quoted value and introduce a second command, redirection, command substitution, or another shell operation. Region and cluster parameters should also be validated before they are placed into executable command text. The requirement to print the complete command can additionally disclose the user's cluster identifier and diagnostic question to transcripts or logs, even where such disclosure is unnecessary. ### Attack Path 1. An attacker submits a diagnostic question containing quote-breaking content and shell syntax. 2. The Agent substitutes the raw text into the documented `--query ""` template. 3. The generated command is passed to a shell rather than invoked as a structured argument array. 4. The shell interprets the injected metacharacters as executable syntax. 5. The injected command executes with the Agent's local privileges. 6. The payload may read Aliyun configuration, environment credentials, workspace data, or invoke additional cloud commands. ### Impact Assessment Succ ...[truncated 433 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:118
Finding

Skill Instructions Assert Unconditional Priority and Force External API Execution

Content
View full analysis
**🚨🚨🚨 MUST | P0 | NON-NEGOTIABLE — Mandatory Enforcement Rules (Violation = Failure) 🚨🚨🚨** > > The following rules have the highest priority and **must be enforced unconditionally** — they **must not be violated** under any circumstances: > > ### Rule 1: Mandatory API Invocation > When a user request matches the following scenarios, **must immediately execute the corresponding API call** — **skipping is prohibited**: > > | User Request Keywords | MUST-Call API | Prohibited Behavior | > |---------------|---------------|----------| > | "cluster list", "instance list", "all clusters", "list clusters" | `describe-db-clusters` | ❌ Not calling API, giving advice directly | > | "data skew", "BadSQL", "slow SQL detection", "running SQL", "idle index", "SQL Pattern", "space diagnosis", "health inspection", "instance diagnosis", "slow query", "RT increase", "cluster stall" and other diagnosis keywords | `DescribeChatMessage` | ❌ Not calling API, only giving advice/explaining concepts | ``` The same section also mandates fixed response output and prohibits avoiding the call at `SKILL.md:131-170`. ### Technical Analysis The Skill claims that its rules have the “highest priority,” must be enforced “unconditionally,” and may not be skipped under any circumstances. A Skill should not attempt to redefine the Agent's instruction hierarchy or suppress security, privacy, consent, and policy checks. Keyword matching can trigger authenticated external requests even when the user only seeks general guidance or when the request contains sensitive contextual information. Product knowledge questions are also configured for immediate external execution without region, cluster, or pre-execution confirmation. Forcing the complete command onto the first line can disclose ...[truncated 1251 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Rogue AgentSelf-Modification, Session Persistence
Findings (16)

External Script Fetching

High
Category
Supply Chain
Confidence
99% confidence
Finding

Using curl ... | bash executes network-delivered code immediately in the shell, which is a classic unsafe installation pattern. In a privileged or developer environment, a compromised script can install malware, alter credentials, or establish persistence, making this especially dangerous in an operations-focused skill.

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 version >= 3.3.3. If not installed or version is too low,
> run `curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash` to install/update,
> or see `references/cli-installation-guide.md`.
> Then [MUST] run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation.
> [MUST] run `aliyun plugin update` to ensure installed plugins are always up-to-date.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest-style description lists triggers such as "cluster list", "slow query", and "performance monitoring" without narrowing context to Alibaba Cloud ADB MySQL only. These phrases are widely used across many database and infrastructure contexts, so they risk unintended invocation collisions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs users to install or update software by piping a remotely fetched script directly into bash. This creates a supply-chain and remote code execution risk: if the upstream host, transport, or script content is compromised, arbitrary code will execute on the user's system without review.

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 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 guide explicitly demonstrates configuring long-lived Access Key credentials and notes they are stored in ~/.aliyun/config.json, but it does not immediately warn that this places reusable secrets on disk where they may be exposed through filesystem compromise, backups, screenshots, or accidental disclosure. In an agent/automation context, encouraging persistent credentials increases the blast radius compared with short-lived or instance-role-based authentication.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document recommends non-interactive secret-bearing CLI flags for scripts, CI/CD, and agent-driven automation without warning that command-line arguments can leak via shell history, process listings, CI logs, telemetry, or copied scripts. Because this skill targets operational automation, that omission is more dangerous: users may paste real secrets into commands that are routinely logged or observable by other processes.

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

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

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly instructs the agent to ignore user-specified --region and --endpoint values and forcibly replace them using an internal routing table. This can cause requests to be sent to a different geographic region or service endpoint than the user intended, creating risks around data residency, compliance, misrouting, and user-surprise; in a diagnostic skill that may process cluster identifiers and operational questions, that context makes the issue more significant rather than less.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The parameter table states --timezone defaults to Asia/Shanghai, which is a locale-specific setting. Because the document does not offer a user choice or explain that this locale is optional and adjustable, it can violate the language/locale policy for users in other regions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This section again specifies Asia/Shanghai as the default timezone for intelligent diagnosis parameters. Requiring a specific locale default across users without offering a choice can conflict with organizational locale policy expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The JSON example sets "language": "en", which imposes a specific language setting in natural-language content. Under the policy rule, locale constraints should either be optional, user-selectable, or clearly justified; this example provides no such caveat.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation recommends system policies including AliyunADBFullAccess for quick configuration even though the skill’s stated functionality is diagnostic and its minimum custom policy is read-only. This can drive users toward over-privileged IAM assignments, increasing blast radius if the skill, its credentials, or downstream integrations are misused or compromised.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.