Back to skill

Security audit

huawei-cloud-flexus-l-server-scripts-excute

Security checks for vulnerabilities and agentic risk

Overview

This skill is for legitimate Huawei Cloud script operations, but it can execute scripts as root and delete cloud scripts without a separate confirmation safeguard.

Review before installing. Use only least-privilege, temporary Huawei Cloud credentials; avoid passing AK/SK/token values on the command line; test only on non-production instances; and treat delete and root execution as high-impact actions that should be manually confirmed outside the skill until the package adds enforced confirmation or dry-run safeguards.

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

Warning
Location
scripts/caller.py:560
Finding
Cloud Script Deletion Is Performed Without an Enforced Confirmation Gate## Vulnerability Details **File Location**: `scripts/caller.py`, lines 560–578 **Vulnerability Type**: Unconfirmed destructive cloud operation **Risk Level**: Medium **Code Snippet**: ```python script_uuid = args.script_uuid or prompt_for_input("Script UUID", required=True) print("\n" + "=" * 60) print("Deleting script...") try: result = delete_script(script_uuid, ak, sk, security_token, region) if result.get("ok"): print("\n[OK] Script deleted successfully!") print(f" {result['text']}") else: print(f"\n[FAIL] Deletion failed: {result.get('error', {}).get('message')}") except Exception as e: print(f"\n[FAIL] Error occurred: {str(e)}") ``` ### Technical Analysis The `delete` command obtains a script UUID from a command-line argument or interactive prompt and immediately invokes `delete_script()`. It does not retrieve and display the target script's identity, request confirmation, require a confirmation flag bound to that UUID, or support a dry-run mode. Supplying the identifier is therefore treated as sufficient authorization for an irreversible cloud-account modification. The underlying `delete_script()` function also performs the API request directly, so there is no lower-level safeguard if the function is called outside the documented CLI workflow. ### Attack Path 1. The Skill runs with Huawei Cloud credentials that include `coc:script:delete`. 2. A caller, mistaken automation instruction, or manipulated Agent invocation selects the `delete` action and supplies a script UUID. 3. `do_delete_script()` accepts the UUID without a separate approval step. 4. The function invokes `delete_script()` using the authenticated user's credentials. 5. The corresponding Huawei Cloud COC script is deleted immediately. This path does not establish malicious intent by the project author. It is a reachable safety defect in a destructive cloud operation. ### Impact Assess ...[truncated 609 chars]
Remediation
## Remediation Suggestions 1. Resolve the UUID to the script's name and metadata, display the exact target, and require an explicit interactive confirmation before deletion. 2. For automation, require a value-bound flag such as `--confirm-delete SC...` and reject the request unless it exactly matches `--script-uuid`. 3. Add a `--dry-run` mode that reports the selected account, region, UUID, and script name without issuing the deletion request. 4. Put the safeguard in the lowest practical shared layer so direct callers of `delete_script()` cannot accidentally bypass it, or expose a separately named low-level API and keep it out of normal Agent workflows. 5. Apply least-privilege IAM policies and omit `coc:script:delete` from credentials used only to create, inspect, or execute scripts. 6. Record non-secret deletion audit data, including the script UUID, region, timestamp, and requesting identity, while ensuring AK, SK, and security-token values are never logged.
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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (23)

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill describes capabilities that rely on environment variables and operational execution, but it does not declare an explicit tool scope such as permissions or allowed-tools. That creates an authorization ambiguity where the runtime may expose broader capabilities than the skill actually needs, increasing the chance of unintended access to secrets or execution-related context.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger keywords are broad operational phrases such as script management, script execution, and cloud operations, which can overlap with ordinary user requests. In a skill that can create and remotely execute scripts on cloud instances, overbroad routing materially raises the risk of accidental activation and unintended high-impact actions.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The file states that scripts must only be run through the skill's controlled exec action, but the rest of the document repeatedly instructs direct shell execution of Python entrypoints. This contradiction undermines the safety boundary, making it more likely an agent or operator will bypass guardrails, execute code outside the intended control path, and expose credentials or run unreviewed commands.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The document says credentials must never be passed on the command line, yet it still documents --ak, --sk, and interactive credential entry as supported authentication methods. In a remote-execution skill, this mixed guidance normalizes unsafe handling of high-value secrets, increasing the likelihood of credential exposure through process lists, shell history, transcripts, logs, or prompts captured by the agent environment.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The routing section repeats broad keywords but does not define activation boundaries, exclusions, or disambiguation rules. Because this skill can execute scripts on remote hosts, ambiguous routing increases the chance that benign discussion about scripts or cloud operations is misinterpreted as a request to invoke a privileged automation skill.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The examples explicitly show AK/SK supplied as plaintext command-line arguments without any warning. In practice, command-line secrets are commonly exposed through shell history, process tables, audit logs, CI logs, and agent transcripts, which is especially dangerous for a cloud administration skill that grants script-management and remote-execution capability.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The execute examples recommend running remote scripts as root with no caution about privilege impact. Because this skill is specifically for batch remote execution on cloud hosts, normalizing root execution increases the chance of destructive system changes, broad compromise from bad scripts, and severe blast radius if commands are misused or generated unsafely.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
This markdown documents a delete operation as standard usage but does not disclose that deleting a script can remove user-managed resources and may be irreversible. The missing warning is relevant because the action affects user data and system configuration state.

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
The document gives conflicting authentication guidance: it requires environment-variable-only credentials while earlier command examples treat passing AK/SK on the CLI as correct. In a security-sensitive cloud-operations skill, this inconsistency can cause users or downstream agents to select the less safe pattern, leading to credential exposure in shell history, process listings, logs, or transcripts.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The verification guide includes deletion commands that remove cloud-managed scripts as part of cleanup, but it does not clearly warn users that these are destructive actions against real tenant resources. In an operations automation context, readers may run the commands in the wrong environment or against non-test assets, causing accidental loss of scripts needed for ongoing administration or audits.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The execution instructions tell the user to run a script on a selected L-instance but do not warn that this performs remote shell execution on a real host and may disclose system details such as hostname/date or modify the target depending on script content. In a cloud operations skill centered on batch script deployment, omission of that warning increases the risk of unsafe use on production instances or sensitive environments.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The CLI exposes a destructive 'delete' capability that is not reflected in the stated skill description focused on script management and execution. This mismatch weakens user/operator expectations and review accuracy, increasing the chance that a caller invokes or permits deletion without understanding the full capability set.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The delete flow performs script deletion immediately after receiving a script UUID, with no confirmation prompt, dry-run, or cautionary notice. Because this skill manages remote-execution scripts, accidental or coerced deletion could disrupt operations, remove deployment assets, or erase artifacts needed for audit and recovery.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The code invokes `client.execute_script(request)` to start execution of a custom script on target instances, which is a safety-critical remote operation. Although the function docstring describes the API, there is no confirmation prompt, visible print/log statement, or other user-facing disclosure at execution time warning that code will run on remote systems.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes support for script management and remote execution, and explicitly highlights creating custom scripts and batch execution scenarios. This file also implements deletion of scripts, which is a materially destructive operation not clearly disclosed by the description's stated examples and scope.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The code deletes a custom script via `client.delete_script(request)`, which is an irreversible/destructive operation. The function contains no confirmation step and no visible user-facing log or warning indicating that deletion is about to occur.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The script explicitly instructs users to pass AK, SK, and a security token on the command line, which can expose secrets through shell history, process listings, terminal logs, CI job logs, and command-auditing tools. In this skill's context, the credentials authorize cloud script management and remote execution, so accidental disclosure could enable unauthorized access and command execution against cloud resources.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The argument parser requires sensitive credentials as CLI parameters without any warning about exposure or safer alternatives. Because this skill is designed for cloud operations and supports remote script creation/execution, leaked credentials could be used to manage scripts or execute actions on target instances, increasing the consequence of credential exposure.

Intent-Code Divergence

Low
Confidence
89% confidence
Finding
The execute-command validation at L124-L127 says success rate must be 0-100, implying 0 is valid. But the parameter validation section at L364-L368 marks '--success-rate 0' as incorrect and says it must be '>= 0.01', creating contradictory intent for consumers implementing or testing the skill.

Context-Inappropriate Capability

Low
Confidence
85% confidence
Finding
The manifest frames the skill as a COC script management and execution tool, but this file additionally implements implicit credential harvesting from process environment variables. While common in CLIs, that capability is not stated in the skill purpose and is not directly about script management or execution behavior itself.

Missing User Warnings

Low
Confidence
85% confidence
Finding
The code silently falls back to reading HW_ACCESS_KEY, HW_SECRET_KEY, HW_SECURITY_TOKEN, and HW_REGION from environment variables. Accessing sensitive credentials is safety-relevant, and this fallback is not disclosed to the user via logging, prompt text, or nearby explanatory warning.

Description-Behavior Mismatch

Low
Confidence
85% confidence
Finding
The manifest focuses on script management and remote execution, but this function retrieves detailed execution records including logs/messages and target host metadata such as agent identifiers, host name, and IP fields. That inspection capability goes beyond the explicitly stated create/execute behavior and should be disclosed if intended.

Unverifiable Dependency: setuptools has 10 known advisory(ies) (CVE-2013-1633 (Setuptools vulnerable to Man-in-the-middle attacks); CVE-2025-47273 (setuptools has a path traversal vulnerability in PackageIndex.download that lead); CVE-2024-6345 (setuptools vulnerable to Command Injection via package URL) +7 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding
The build dependency on setuptools is only constrained as ">=61.0", which does not ensure installation of a version that is free from known advisories. This creates supply-chain uncertainty during builds, because vulnerable setuptools releases could be selected depending on the environment or resolver behavior.

Static analysis

No suspicious patterns detected.