Back to skill

Security audit

Alibabacloud Csas User Device Ops

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-built for Alibaba Cloud SASE administration, but it needs review because it can change live device state and local Aliyun CLI configuration with insufficiently safe setup and cleanup scripts.

Install only in an environment where the Aliyun CLI and CSAS plugin are pinned or otherwise trusted, use least-privilege RAM permissions, avoid pasting credentials into commands or chats, and review dry-run output carefully before any device lock. Treat cleanup-inactive.sh as risky until JSON parsing and failure reporting are fixed.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cleanup-inactive.sh:151
Finding

Independent regex-based JSON extraction can associate inactivity timestamps with the wrong devices

Content
View full analysis
/dev/null | \ sed "s/.*\"${field}\"[[:space:]]*:[[:space:]]*\"\([^\"]*\)\".*/\1/" || true } ``` ```bash # scripts/cleanup-inactive.sh:151-155 tags=(); usernames=(); hostnames=(); types=(); update_times=() while IFS= read -r v; do tags+=("$v"); done < <(json_extract_all "$all_devices" "DeviceTag") while IFS= read -r v; do usernames+=("$v"); done < <(json_extract_all "$all_devices" "Username") while IFS= read -r v; do hostnames+=("$v"); done < <(json_extract_all "$all_devices" "Hostname") while IFS= read -r v; do types+=("$v"); done < <(json_extract_all "$all_devices" "DeviceType") while IFS= read -r v; do update_times+=("$v"); done < <(json_extract_all "$all_devices" "UpdateTime") ``` ```bash # scripts/cleanup-inactive.sh:160-182 for i in "${!tags[@]}"; do ut="${update_times[$i]:-}" is_inactive=false if [[ -z "$ut" ]]; then [[ -z "$cutoff_max_date" ]] && is_inactive=true else update_date="${ut:0:10}" if [[ -n "$cutoff_max_date" ]]; then [[ ! "$update_date" < "$cutoff_max_date" && "$update_date" < "$cutoff_date" ]] && is_inactive=true else [[ "$update_date" < "$cutoff_date" ]] && is_inactive=true fi fi if [[ "$is_inactive" == "true" ]]; then inactive_tags+=("${tags[$i]}") inactive_users+=("${usernames[$i]:-unknown}") inactive_hosts+=("${hostnames[$i]:-unknown}") inactive_types+=("${types[$i]:-unknown}") inactive_times+=("${ut:-never}") fi done ``` ### Technical Analysis The script does not parse each `Devices[]` JSON obje ...[truncated 2102 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cleanup-inactive.sh:224
Finding

Lock-operation failures are suppressed and the script reports success unconditionally

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/validate-cli.sh:87
Finding

Mutable CLI binaries and plugins are installed or updated without integrity verification

Content
View full analysis
/dev/null 2>&1 || true log_info "Auto-plugin-install enabled" plugin_update_ok=true if ! aliyun plugin update >/dev/null 2>&1; then plugin_update_ok=false log_warn "Plugin update failed (non-critical)" fi ``` ```bash # references/cli-installation-guide.md:37-46 **Debian/Ubuntu** ```bash # Download wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz # Extract and install tar -xzf aliyun-cli-linux-latest-amd64.tgz sudo mv aliyun /usr/local/bin/ # Verify aliyun version ``` ``` Equivalent mutable `latest` downloads are also documented for macOS, CentOS/RHEL, ARM64, and Windows. ### Technical Analysis The workflow enables automatic plugin installation and performs an unpinned plugin update. The installation guide downloads archives named `latest`, extracts them, and moves the resulting executable into a privileged system path. It supplies no expected version, cryptographic digest, signature verification, trusted-key procedure, or archive-content validation. HTTPS protects the transport connection but does not provide artifact immutability or protect users if an upstream publishing account, repository, update channel, or CDN origin is compromised. Because the retrieved artifacts are executable and run with access to Alibaba Cloud credentials, dependency compromise has a high-value execution context. The use of `sudo mv` can overwrite a system-wide CLI executable, affecting users and processes beyond the current skill session. ...[truncated 1281 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

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

Credential configuration examples expose cloud secrets through command-line arguments and shell history

Content
View full analysis
\ --access-key-secret \ --region cn-hangzhou ``` ```bash # references/cli-installation-guide.md:130-134 aliyun configure set \ --mode AK \ --access-key-id LTAI5tXXXXXXXX \ --access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \ --region cn-hangzhou ``` ```bash # references/cli-installation-guide.md:161-166 aliyun configure set \ --mode StsToken \ --access-key-id LTAI5tXXXXXXXX \ --access-key-secret 8dXXXXXXXXXXXXXXXXXXXXXXXX \ --sts-token v1.0:XXXXXXXXXXXXXXXX \ --region cn-hangzhou ``` ### Technical Analysis The guide encourages users to place access-key IDs, access-key secrets, and STS tokens directly into command-line arguments. Commands entered interactively are commonly retained in shell history. Depending on the operating system and process-inspection controls, arguments may also be visible to other local users while the process is running. Terminal capture, support transcripts, CI logs, and command auditing can create further copies. This guidance conflicts with the primary skill's security rule that access keys and secrets must never be read, echoed, or printed in conversation. Even though the sample values are placeholders, users are instructed to replace them with real credentials. Environment-variable examples elsewhere in the guide also require care because inherited process environments can be exposed through diagnostics or child processes. ### Attack Path 1. A user follows the documented command and substitutes a real access-key secret or STS token. 2. The complete comm ...[truncated 922 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims to focus on CSAS device and user operations, but it also instructs the agent to mutate the local Aliyun CLI environment by enabling auto-plugin installation, updating plugins, and toggling AI-mode. Those side effects expand the trust boundary from remote CSAS queries to local workstation configuration, which can surprise users, introduce supply-chain risk through plugin updates, and alter the user's CLI state beyond the stated business function.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% 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 · SKILL.md (reported line 316)May include surrounding context.

md
**[MUST] All write operations require user confirmation:**
1. Present what will be done (target devices/users, action, count)
2. Ask user to confirm and **wait for explicit yes**
3. Only execute after user confirms — NEVER auto-execute

**[MUST] Cancellation handling:**
When user cancels (replies "no", "cancel", "stop", or anything other than explicit confirmation):

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The reference expands the skill’s effective capability surface beyond the manifest by documenting get-user-device, get-active-idp-config, and list-user-groups. In agent settings, hidden or undeclared callable operations undermine least-privilege and user/operator expectations, and can expose additional sensitive identity, group, and device metadata not implied by the stated terminal-management use case.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Active IDP configuration retrieval is unrelated to the advertised device and user-device management workflow, yet it reveals identity-provider metadata that can aid reconnaissance and privilege mapping. Because the skill handles enterprise SASE administration, exposing identity configuration through an unnecessary API increases the blast radius if the agent is over-permissioned or prompt-manipulated.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest says the skill supports locking inactive devices and does not support broader irreversible operations, but the reference documents Lost, Unbound, Unlocked, and Found actions as generally available. This mismatch can let an agent invoke state-changing operations beyond the promised scope, including unbinding devices, which has stronger operational impact than simple locking.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The batch device-status update API performs impactful state changes on up to 100 devices per call, including Lost and Unbound, but the documentation lacks strong warnings, confirmation requirements, or rollback guidance. In an agent context, this increases the chance of accidental or prompt-induced disruptive actions affecting endpoint access and user productivity.

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

The guide recommends non-interactive credential configuration with secrets passed directly on the command line, which can persist in shell history, process listings, CI job logs, and local config files. Because the skill is meant for agent-driven automation, this pattern is especially risky: it encourages exactly the environments where secret leakage through logs and persistent state is common.

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

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Documenting general-purpose AK credentials plus role-assumption and cross-account access exceeds the narrow SASE terminal management use case and normalizes use of elevated credentials. In the context of an agent skill, this increases the blast radius if the skill is misused, misconfigured, or invoked in an environment with overly broad permissions.

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

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The guide expands from a CSAS-focused skill into general Alibaba Cloud CLI plugin installation and exploration of unrelated services such as ECS, VPC, RDS, and FC. In an agent skill, this broadens the reachable capability surface beyond the declared purpose and can enable misuse or operator confusion that results in actions against unintended products or accounts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document recommends attaching the broad system policy AliyunCSASFullAccess as the quickest setup, even though this skill includes a write capability (csas:UpdateUserDevicesStatus) that can lock or otherwise change device status. Presenting full access as the primary setup path increases the chance of over-privileged deployments and unintended modification of production devices, especially if operators only need read-only queries.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file documents write-capable device status change commands, including locking and unlocking endpoints, without any cautionary note, confirmation guidance, or explicit operator safeguards. In this skill’s context, device locking is a real administrative action that can disrupt user access or cause operational denial of service if invoked carelessly, especially since the same reference mixes read-only and write commands in one quick-use document.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This script is presented as a validator, but it performs persistent state changes by enabling Aliyun CLI auto-plugin-install and attempting a plugin update. In a security-sensitive environment, a validation step that silently mutates client configuration expands the attack surface, may violate change-control expectations, and can trigger unreviewed plugin downloads from external sources.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The surrounding comment frames this section as a check, but the implementation changes CLI configuration instead of only inspecting it. This mismatch is dangerous because operators, automation, or higher-level agents may treat the script as safe to run in audit mode while it actually alters security-relevant settings without explicit consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. The example config sets "language": "en", which can be read as forcing a specific language preference, and the document does not indicate that users may choose another locale or that English is required for a justified regional reason.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The file-level documentation and help text describe this script as a read-only inactive-device analysis with no write operations. However, the output note explicitly directs users to cleanup-inactive.sh to lock devices, introducing an operational action beyond the documented read-only scope of this script's intent messaging.

Content

No source excerpt is available for this finding.