Back to skill

Security audit

alibabacloud-wuying-console

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Alibaba Cloud WUYING administration skill, but it exposes powerful cloud actions, including deletion and remote script execution, without enforcing its own confirmation rules in the executable wrapper.

Install only if you intend to let an agent administer Alibaba Cloud WUYING resources with your active OAuth profile. Use a least-privilege account, prefer read-only permissions unless mutation is needed, and require fresh, target-specific confirmation for any create, modify, delete, reset, rebuild, release, or run-command operation. Treat remote script execution and tenant skill administration as especially sensitive.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run_wuying.py:58
Finding

Destructive Cloud Operations Lack an Executable Confirmation Gate

Content
View full analysis

Vulnerability Details

File Location: scripts/run_wuying.py:58-86
Vulnerability Type: Missing authorization and confirmation enforcement for destructive operations
Risk Level: High

Vulnerable Code

python
def main() -> int:
    command = sys.argv[1:]
    if command[:1] == ["--"]:
        command = command[1:]
    try:
        aliyun = shutil.which("aliyun")
        if not aliyun:
            raise ValueError("official Aliyun CLI is not installed")
        specs = json.loads((ROOT / "references" / "products.json").read_text(encoding="utf-8"))
        # The workflow already checks remote updates. This fresh execution gate
        # intentionally performs only local CLI/plugin/profile checks.
        checked = subprocess.run(
            [sys.executable, str(ROOT / "scripts" / "check_environment.py"),
             "--aliyun-bin", aliyun, "--skip-update-check"],
            capture_output=True, text=True, check=False, timeout=60,
        )
        if checked.returncode not in {0, 4}:
            raise ValueError("OAuth/plugin preflight failed; no business request was sent")
        evidence = json.loads(checked.stdout)
        validate_request(command, specs, evidence)
    except (ValueError, OSError, KeyError, TypeError, AttributeError, subprocess.TimeoutExpired) as error:
        # Do not echo raw CLI diagnostics, argv, profile contents or credentials.
        detail = str(error) if isinstance(error, ValueError) and not isinstance(error, json.JSONDecodeError) else "preflight evidence unavailable"
        print(json.dumps({"status": "blocked", "request_sent": False, "reason": detail,
                          "next_action": "stop_business_execution",
                          "credential_fallback_allowed": False,
                          "direct_cli_sdk_http_retry_allowed": False}, ensure_ascii=False))
        return 2
    return subprocess.run([aliyun, *command[1:]], check=False).returncode

Technical Analysis

The Skill document ...[truncated 2867 chars]

Remediation
View remediation

Remediation Suggestions

Enforce the safety policy in the executable entry point rather than relying solely on Agent instructions:

  1. Classify every requested command using trusted catalog or live plugin metadata before execution.
  2. Reject mutation and destructive commands by default unless fresh confirmation evidence is supplied.
  3. Bind confirmation evidence to the exact account/profile, region, product, API version, action, resource identifiers, and material parameter values.
  4. Make confirmations short-lived and single-use so they cannot be replayed for a different operation or target set.
  5. Reject destructive requests containing wildcards, empty filters, unresolved identifiers, or account-wide target sets.
  6. Re-query targets immediately before destructive execution where resource membership may have changed.
  7. Consider separating read-only and state-changing execution paths, with the latter requiring an authenticated local approval channel or interactive confirmation.
  8. Add automated tests proving that direct wrapper invocation cannot execute mutation or destructive commands without valid, target-bound approval.
  9. Preserve the existing OAuth, plugin, product-scope, API-version, and authentication-override checks as defense-in-depth controls.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (18)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python3 scripts/generate_command_catalog.py

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The catalog exposes commands outside the declared scope of WUYING resource management, including tenant skill-management and operational capabilities that materially expand what the agent could do. This creates a dangerous authority mismatch: users may invoke the skill for benign cloud administration while the skill can reach unrelated control planes and perform sensitive actions not justified by its purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The presence of run-command enables remote script execution on cloud computers, which is far more powerful than discovery or routine resource management. If the skill or downstream agent can select this command, an attacker could achieve arbitrary code execution in managed desktops, leading to data theft, persistence, lateral movement, or destructive actions.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/generate_command_catalog.py (reported line 77)May include surrounding context.

python
# Pin plugin/kebab help, not the traditional PascalCase surface: those
    # spellings route through different CLI engines. Keep overrides local to
    # the metadata subprocess and request machine output explicitly.
    help_env = dict(os.environ)
    help_env["ALIBABA_CLOUD_ORIGINAL_PRODUCT_HELP"] = "false"
    help_env["ALIBABA_CLOUD_BASELINE_PRODUCT_HELP"] = "true"
    output = run_command([

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill clearly instructs the agent to use shell, environment variables, local file reads, and network-backed CLI/plugin/documentation access, but it does not declare any explicit tool scope such as allowed-tools or permissions. That mismatch weakens policy enforcement and review because the runtime may grant broader capabilities than the manifest communicates, increasing the chance of unintended command execution or data exposure.

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

md
Classify the user's intent before environment remediation, installation, or
resource discovery. For any state-changing request, read
[safety.md](references/safety.md) first. An unresolved wildcard or account-wide
destructive request must stop with an explicit refusal to bypass confirmation;
do not upgrade/install software, log in, or enumerate resources to advance it.
Offer a separately scoped read-only inventory instead, without executing it.
For other tasks, authorization to operate on cloud resources is not authorization

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

md
OAuth profile from the environment check. `blocked` and `needs_auth` are execution
gates, not warnings. A valid AccessKey or StsToken profile does not satisfy the
OAuth requirement; never fall back to it. Software installation authorization is
separate from cloud-operation authorization. A request to skip confirmation does
not authorize unresolved, wildcard, or account-wide destructive targets.

For cloud tasks, proceed only when `checks.valid_oauth_profile` is the literal

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The instruction says to convert the user's intent into a short English search phrase, which imposes an English-language requirement regardless of the user's preferred language. This is a natural-language policy issue because the skill does not offer a language choice or explain a justified locale restriction.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% 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 174)May include surrounding context.

md
- Use the catalog's `preferred_api_version`, which is the latest OAuth-compatible version for the exact command. Never select a newer version excluded by the product's `oauth_api_versions` configuration.
- Read live help immediately before execution because plugin upgrades can change parameters after this catalog was generated.
- Use exact parameter names and types from live help. Do not invent parameters from console labels or memory.
- This Skill does not support client-session contracts. Never ask the user for `client-id`, `login-token`, or `session-id`, and never place those values in a command template. If an operation has no OAuth-compatible catalog entry, report that the operation is unsupported by this Skill and stop.
- Never guess `RegionId`, resource IDs, account IDs, names, or selection order. Query authoritative resources first, present ambiguous matches, and validate the chosen ID against the query result.
- Add `--cli-ai-mode` and the required workflow `--user-agent` to every cloud API
  execution command so the CLI records agent-mode usage and the calls are

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
### Verify the official API contract before execution

Before the first business API call for each exact Product + API Version + Action
in a workflow, read its official documentation in [OpenAPI Explorer](https://api.aliyun.com/)
or [Alibaba Cloud Help Center](https://help.aliyun.com/). Use the API Action from
live CLI help to find the matching page; do not substitute another version or a
similarly named API. Reuse the checked contract for pagination and repeated calls

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The file enumerates a very broad set of generic command names covering read, mutation, destructive, and administrative operations without visible narrowing constraints. In an agent setting, this can increase accidental or adversarial routing to sensitive actions because common user requests may ambiguously match high-impact commands.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Tenant skill-management commands are unrelated to the declared function of managing WUYING console resources and broaden the skill into administering other skills and identities. This unnecessary cross-domain capability increases the chance of privilege abuse, misconfiguration, or unauthorized enablement/authorization of skills within the tenant.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% 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/command-catalog.json (reported line 3349)May include surrounding context.

json
},
        {
          "name": "untag-resources",
          "description": "Removes tags from cloud desktops. After a tag is removed, if the tag is not added to any cloud desktop, the tag is automatically deleted",
          "api_versions": [
            "2020-09-30"
          ],

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 · scripts/check_environment.py (reported line 106)May include surrounding context.

python
command: list[str],
    timeout: int | None = None,
) -> subprocess.CompletedProcess[str]:
    return subprocess.run(
        command,
        check=False,
        stdout=subprocess.PIPE,

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 · scripts/generate_command_catalog.py (reported line 48)May include surrounding context.

python
def run_command(command: list[str], *, env: dict[str, str] | None = None) -> str:
    completed = subprocess.run(
        command,
        check=False,
        stdout=subprocess.PIPE,

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 · scripts/run_wuying.py (reported line 69)May include surrounding context.

python
specs = json.loads((ROOT / "references" / "products.json").read_text(encoding="utf-8"))
        # The workflow already checks remote updates. This fresh execution gate
        # intentionally performs only local CLI/plugin/profile checks.
        checked = subprocess.run(
            [sys.executable, str(ROOT / "scripts" / "check_environment.py"),
             "--aliyun-bin", aliyun, "--skip-update-check"],
            capture_output=True, text=True, check=False, timeout=60,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
88% confidence
Finding

This code ultimately executes the external Aliyun CLI with user-supplied arguments after only partial validation. Although it avoids shell injection by using a list, it still permits an agent/user to trigger real cloud-management actions against allowed WUYING products, creating a command-execution/delegation surface that can cause unauthorized or destructive operations if higher-level authorization and action allowlisting are absent.

Content

Scanner excerpt · scripts/run_wuying.py (reported line 86)May include surrounding context.

python
"credential_fallback_allowed": False,
                          "direct_cli_sdk_http_retry_allowed": False}, ensure_ascii=False))
        return 2
    return subprocess.run([aliyun, *command[1:]], check=False).returncode


if __name__ == "__main__":

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The verified narrow rule cites a Help Center URL under the Chinese-language path (/zh/), which suggests a locale-specific documentation requirement. The file does not indicate that this locale choice is optional or justified as a region-specific exception for users.

Content

No source excerpt is available for this finding.