Back to skill

Security audit

Alibabacloud Smartag Pilot

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate Alibaba Cloud SAG inspection skill, but it asks agents to run unsafe installer commands and handle sensitive cloud data in ways users should review carefully.

Install only after reviewing the setup path. Do not let an agent run the pipe-to-bash installer or install unverified `latest` archives with sudo. Use a short-lived, read-only RAM role or tightly scoped profile, avoid putting secrets directly on command lines, and treat generated `/tmp` files and reports as confidential cloud-infrastructure data.

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:15
Finding

Unverified Remote Installation Script Executed Directly by Bash

Content
View full analysis
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 install/update, > or see `references/cli-installation-guide.md` for installation instructions. ``` ### Technical Analysis The Skill directs the Agent to retrieve a mutable remote script and immediately execute it with Bash. There is no pinned script version, checksum validation, cryptographic signature verification, local review step, or confirmation of the final resolved download location. The apparent vendor association of the domain does not provide content integrity. The effective code executed during a future invocation can differ from the code available when the Skill was audited. A compromise of the hosting service, CDN, DNS resolution, publisher account, or release process could consequently turn this installation command into arbitrary code execution. Installing a CLI dependency is related to the declared functionality, but piping a remote response directly to a shell is not necessary. The project already documents package-manager and separately downloaded binary installation alternatives. ### Attack Path 1. A user invokes the Skill on a system where Aliyun CLI is absent or older than the required version. 2. The Agent follows the pre-check instructions and runs the `curl | bash` command. 3. The remote service returns a compromised or malicious script. 4. Bash executes the response without first authenticating or inspecting it. 5. The payload executes with all privileges available to the Agent process. 6. It can access local files and configured Alibaba Cloud credentials, alter the CLI, install additional code, or manipulate later inspection results. ### Impact Assessment Successful exploitation provides arbitrary code execu ...[truncated 339 chars]
Remediation
View remediation

T08 · Insecure Dependencies

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

Unchecked Mutable Binary Archives Installed into Privileged PATH Locations

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
references/contract-skeletons.md:21
Finding

Predictable Shared Temporary Files Enable Symlink Overwrites and Result Tampering

Content
View full analysis
" SAG_ID="" SN="" aliyun smartag describe-smart-access-gateways --biz-region-id "$REGION" --smart-ag-id "$SAG_ID" > /tmp/sag_a01.json # A1 aliyun smartag describe-smart-access-gateway-attribute --biz-region-id "$REGION" --smart-ag-id "$SAG_ID" > /tmp/sag_a02.json # A2 aliyun smartag describe-sag-device-info --biz-region-id "$REGION" --smart-ag-sn "$SN" > /tmp/sag_a03.json # A3 (skip if sag-software) aliyun smartag describe-sag-wan-list --biz-region-id "$REGION" --smart-ag-sn "$SN" > /tmp/sag_a04.json # A4 (skip if sag-software) aliyun smartag describe-sag-static-route-list --biz-region-id "$REGION" --smart-ag-id "$SAG_ID" > /tmp/sag_a05.json # A5 aliyun smartag describe-sag-route-list --biz-region-id "$REGION" --smart-ag-id "$SAG_ID" > /tmp/sag_a06.json # A6 aliyun smartag describe-dnat-entries --biz-region-id "$REGION" --sag-id "$SAG_ID" > /tmp/sag_a07.json # A7 aliyun smartag describe-snat-entries --biz-region-id "$REGION" --smart-ag-id "$SAG_ID" > /tmp/sag_a08.json # A8 aliyun smartag describe-cloud-connect-networks --biz-region-id "$REGION" > /tmp/sag_a09.json # A9 aliyun smartag describe-acls --biz-region-id "$REGION" > /tmp/sag_a10.json # A10 aliyun smartag describe-qoses --biz-region-id "$REGION" > /tmp/sag_a11.json # A11 aliyun smartag describe-sag-current-dns --biz-r ...[truncated 1791 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

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

Cloud Credentials Are Recommended as Literal Command-Line Arguments

Content
View full analysis
\ --access-key-secret \ --region cn-hangzhou ``` All `aliyun configure` commands support non-interactive flags, which is the recommended approach — it works in scripts, CI/CD pipelines, and agent-driven automation without hanging on stdin prompts. ``` Similar literal Access Key and STS token examples recur throughout the guide. ### Technical Analysis The guide recommends placing Alibaba Cloud Access Key IDs, Access Key secrets, and STS tokens directly in command-line arguments. When users replace the placeholders, secrets may be retained in shell history, CI/CD logs, command transcripts, process telemetry, audit records, or generated automation scripts. This guidance conflicts with the safer rules in `SKILL.md`, which prohibit using `aliyun configure set` with literal credential values during Agent operation. Because `SKILL.md` links users to this guide when credentials are absent, users may reasonably follow the less secure instructions. ### Attack Path 1. The Skill detects that no valid Aliyun profile exists and directs the user to configure credentials outside the session. 2. The user opens the linked guide and follows the recommended non-interactive command. 3. The user substitutes an actual Access Key secret or STS token into the command line. 4. The command is retained by shell history, CI output, process monitoring, terminal logging, or automation artifacts. 5. Another local user, log reader, or compromised process retrieves the credential. 6. The credential is reused against Alibaba Cloud within the permissions granted to its identity. ### Impact Assessment Exposure grants the attacker the clo ...[truncated 330 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/ram-policies.md:35
Finding

Suggested Account-Wide RAM Policy Includes Explicitly Unused API Permissions

Content
View full analysis
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
  • Rogue AgentSelf-Modification, Session Persistence
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (20)

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

This is a direct external-script-fetch-and-execute pattern: downloading setup.sh from the internet and piping it to bash. In an agent skill with shell capability, that is a strong code-execution primitive and materially more dangerous than a normal documentation snippet because the agent may follow it automatically.

Content

Scanner excerpt · SKILL.md (reported line 16)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 install/update,
> or see `references/cli-installation-guide.md` for installation instructions.

> **Pre-check: SAG plugin installed and up-to-date**

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill clearly instructs shell execution and file generation, but it declares no explicit tool scope such as allowed-tools or permissions. That mismatch weakens least-privilege controls and can cause an agent runtime to expose broader shell/file capabilities than reviewers or users expect, especially since the skill also writes scripts and report files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill tells the agent to execute a remotely downloaded installer via curl ... | bash, which runs unverified network content directly in the shell. If the host, CDN path, TLS trust chain, or downloaded script is compromised, this becomes immediate arbitrary code execution in the agent environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The workflow directs the agent to modify a Python template, write it into the user's workspace, and execute it. Even though the template is local, this expands the skill from read-only cloud inspection into code generation and execution, creating a path for arbitrary local actions if the template, parameters, or surrounding environment are tampered with.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example code filters regions by checking whether the Chinese phrase "已关停" appears in LocalName. This embeds a language-specific assumption in the skill guidance, and the document does not offer a locale choice or explain that the API is guaranteed to return Chinese-localized names.

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 keys via command-line flags and notes that configuration is stored in ~/.aliyun/config.json, but the warning about securing that file appears much later. In an agent skill context, this increases the chance users or automation persist sensitive credentials on disk without understanding the exposure risk, especially on shared hosts or developer workstations.

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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The environment variable examples encourage placing secrets directly into shell environment variables without nearby guidance about shell history, process/environment leakage, CI log exposure, or ephemeral session handling. In automation-focused documentation, this can lead to credential disclosure through debugging output, inherited environments, or improperly secured pipelines.

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 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
98% confidence
Finding

The document content is written in Chinese and does not provide an alternative language option or state that the skill is region-specific. Under the policy rule, forcing a specific language or locale without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown reference is written entirely in Chinese and provides no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or region-specific audience. Under the language/locale policy rule, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation explicitly highlights sensitive response fields such as usernames/emails, client IPs, and other network configuration data without any warning about minimization, redaction, storage limits, or access control. In a skill designed to generate inspection reports, this increases the chance that personally identifying and infrastructure-sensitive data will be collected and written into files or logs by downstream agent behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script's natural-language instructions, console output, and generated report content are written in Chinese throughout, which imposes a specific language on users without opt-in. Under the language/locale policy, this is a natural-language policy issue unless the file explicitly offers language selection or clearly justifies a locale-specific scope.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · references/status_inspection_template.py (reported line 143)May include surrounding context.

python
cmd.extend([f"--{param_name}", str(v)])

        try:
            result = subprocess.run(cmd, capture_output=True, text=True, timeout=50)
            if result.returncode == 0:
                return json.loads(result.stdout)
            else:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file is predominantly in English, but this section introduces Chinese-only device-role labels and a Chinese-language explanatory table without user opt-in or justification for the language shift. That creates a natural-language locale policy issue because the skill effectively forces a specific language for part of the content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This Python file performs filesystem operations by creating the output directory and writing a Markdown report, but the code does not include any confirmation prompt or explicit warning that an existing same-named report file may be overwritten. Although the header mentions writing a modified script to the workspace, it does not clearly disclose this report-generation side effect to the end user at the point of execution.

Content

No source excerpt is available for this finding.