Back to skill

Security audit

alibabacloud-pai-rec-diagnosis

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this skill suspicious with medium confidence because its diagnosis purpose is accompanied by risky installation and persistent CLI changes, plus a reported credential-sanitization weakness; scanner coverage was partial.

Consider the reported installation, plugin-update, and credential-handling risks before installing. The scans were partial: 13 of 15 components were scanned, and the tool-poisoning analyzer was degraded, so the evidence is incomplete. The verdict is suspicious, which places the skill in ClawHub's Review bucket; it does not establish malicious intent.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • 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
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (30)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The mandatory prerequisites persistently enable automatic plugin installation and update existing plugins without a separate approval step. These changes exceed read-only diagnosis, affect subsequent CLI usage, and introduce unpinned executable dependencies into a credential-bearing environment.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Service inspection, log retrieval, and configuration reads support the declared diagnostic and validation purpose. Creating and applying configurations are state-changing capabilities not disclosed by that purpose. The chunk is a reference command list, so it does not establish that these operations are actually executed, but it includes operational capabilities beyond diagnosis and validation.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
99% confidence
Finding

The curl-to-bash pipeline immediately executes mutable remote content without artifact verification or review. HTTPS and a vendor-associated domain do not prevent execution of malicious code following an upstream compromise, which is especially consequential on a cloud-authenticated workstation.

Content

Scanner excerpt · SKILL.md (reported line 37)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: Aliyun CLI plugin update required**

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

The suggested command recursively removes all matching session directories rather than only the current session's artifacts. This can delete another concurrent invocation's files, though the manual-only context limits exposure and does not imply deletion outside the matching paths.

Content

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

md
(see Core Workflow preamble). The skill does NOT delete `$WORKDIR` automatically
— the OS-level temp policy reclaims it (macOS reaps `/tmp` periodically; most
Linux distros reap on reboot or via `systemd-tmpfiles`). To free disk space
sooner, manually run `rm -rf /tmp/pairec-diag-*` outside the workflow.

---

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
(see Core Workflow preamble). The skill does NOT delete `$WORKDIR` automatically
— the OS-level temp policy reclaims it (macOS reaps `/tmp` periodically; most
Linux distros reap on reboot or via `systemd-tmpfiles`). To free disk space
sooner, manually run `rm -rf /tmp/pairec-diag-*` outside the workflow.

---

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
89% confidence
Finding

The wildcard cleanup deletes every matching directory accessible to the user, including artifacts from other active diagnostic sessions. Although manual and limited to a specific temporary-directory prefix, it defeats the workflow's explicit parallel-session isolation and can destroy ongoing diagnostic evidence.

Content

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

md
(see Core Workflow preamble). The skill does NOT delete `$WORKDIR` automatically
— the OS-level temp policy reclaims it (macOS reaps `/tmp` periodically; most
Linux distros reap on reboot or via `systemd-tmpfiles`). To free disk space
sooner, manually run `rm -rf /tmp/pairec-diag-*` outside the workflow.

---

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The installation command immediately executes whatever the remote setup endpoint returns. HTTPS protects transport but does not pin or authenticate a particular script release against publisher or distribution compromise, creating arbitrary-code-execution exposure on a machine that may hold cloud credentials.

Content

Scanner excerpt · references/troubleshooting-guide.md (reported line 52)May include surrounding context.

Solution:

  1. Install Aliyun CLI:

    bash
    curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash
    
  2. Reload shell configuration:

Chaining Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

The pipeline connects network-controlled script content directly to a shell interpreter, bypassing an inspection and verification stage. This confirms the same unsafe installation mechanism as the SC2 finding at this line, rather than separate evidence of malicious chaining.

Content

Scanner excerpt · references/troubleshooting-guide.md (reported line 52)May include surrounding context.

Solution:

  1. Install Aliyun CLI:

    bash
    curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash
    
  2. Reload shell configuration:

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The update procedure fetches and immediately executes an unpinned remote script. A compromised or unexpectedly changed script could access the diagnostic user's files and cloud credentials or modify their environment.

Content

Scanner excerpt · references/troubleshooting-guide.md (reported line 80)May include surrounding context.

Solution:

  1. Update Aliyun CLI:

    bash
    curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash
    
  2. Verify update:

Chaining Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

The update pipeline executes remote content with the current user's privileges without a verification checkpoint. This is the same supply-chain execution risk identified by SC2 at this location, not an additional demonstrated attack.

Content

Scanner excerpt · references/troubleshooting-guide.md (reported line 80)May include surrounding context.

Solution:

  1. Update Aliyun CLI:

    bash
    curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash
    
  2. Verify update:

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_read, file_write, network, shell.

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.

Installation pre-checks modify the local environment without warning about remote code execution or persistent CLI changes.

Medium
Category
Output Handling
Confidence
97% confidence
Finding

The installation pre-check directs execution of a remotely fetched shell script and mandates persistent CLI/plugin changes without a dedicated consent gate. In a cloud diagnostic session, compromised installation content could execute with the operator's privileges and access locally available credentials.

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

❌ INCORRECT - Using hardcoded or assumed values

bash
# Hardcoded region without confirmation
aliyun eas describe-service \
  --cluster-id cn-hangzhou \           # Never assume
  --service-name embedding_recall

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

--cluster-id cn-hangzhou \ # Never assume --service-name embedding_recall

Assumed time range without asking user

--start-time "2025-04-28T00:00:00Z" \ # Should confirm with user --end-time "2025-04-28T23:59:59Z"

text

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/service-log-diagnosis.md (reported line 17)May include surrounding context.

md
| `request-id` | Required for request trace follow-up | Full identifier from a retrieved business log | N/A |
| `profile` | Required when specified | User-selected Aliyun CLI profile, including `default` | Omit only when not specified |

Use supplied parameters; the console has already selected the region, service, environment and time range. Ask only for missing or conflicting values, not instance IDs, configuration names or a request ID before a time-window scan. For supplied log-response JSON, analyze offline without asking for cloud parameters.

**Service name mapping:** For base PAI-Rec service `shop_rec`, production uses `shop_rec` and pre-release uses `shop_rec_pre`. When the frontend provides `PAI-EAS service name`, pass it unchanged; do not append another `_pre`. When both names are provided, verify the resolved name agrees with the selected environment. Do not infer an environment from a service name alone.

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

No error checking

SERVICE_INFO=$(aliyun eas describe-service --cluster-id cn-hangzhou --service-name test)

Process results without checking if command succeeded

(May fail silently or with confusing errors)

text

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

bash
# Assume commands always succeed
SERVICE_INFO=$(aliyun eas describe-service ...)
# Process without checking if result is valid

# No check if logs/configs found
# May process empty results

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

fi

text

#### ❌ INCORRECT - No verification

```bash
# Assume commands always succeed

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
# Extract and install
tar -xzf aliyun-cli-linux-latest-amd64.tgz
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
# Extract and install
tar -xzf aliyun-cli-linux-latest-amd64.tgz
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

Recommends passing credentials on the command line without warning about credential exposure.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

The guide recommends supplying access-key secrets as command-line arguments without warning that expanded credentials can appear in process inspection, shell history, CI logs, or agent execution records. In a cloud-diagnostics workflow, disclosure could permit access to cloud resources within the credentials' permissions; later file-permission guidance does not address these exposure paths.

Content

No source excerpt is available for this finding.

The skill prescribes updating all installed CLI plugins, exceeding the needs of PAI-Rec diagnosis and configuration validation.

Medium
Category
Excessive Agency
Confidence
94% confidence
Finding

The reference makes updating all installed CLI plugins a prerequisite rather than limiting changes to dependencies actually needed for diagnosis. This modifies unrelated executable components, introducing compatibility and supply-chain risks beyond the requested diagnostic scope.

Content

No source excerpt is available for this finding.

CLI installation and update steps execute a remote script without warning about system changes or obtaining confirmation.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

Installation and update instructions pipe a mutable remote script directly into bash without inspection or integrity verification. Although the URL appears vendor-associated, compromised distribution infrastructure could execute arbitrary code with the diagnostic user's permissions, potentially exposing cloud credentials; this overlaps the individual SC2 and TM2 findings.

Content

No source excerpt is available for this finding.