Back to skill

Security audit

huawei-cloud-optv-evolve-management

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated Huawei Cloud automation purpose, but its optional OBS upload setup tells users to create a permanent, broadly privileged cloud delegation.

Install only if a Huawei Cloud operator reviews the cloud permissions. Prefer the default no-OBS-upload path. If OBS upload is needed, replace the sample agency policy with least-privilege bucket/prefix-scoped permissions, avoid FOREVER duration, confirm the trusted principal, and revoke/delete the agency and policy after use. Never paste AK/SK values into chat or logs.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/iam-agency.md:81
Finding
Overprivileged, Indefinite OBS Delegation to an External Service Account## Vulnerability Details **File Location**: `references/iam-agency.md`, lines 81–156 **Vulnerability Type**: Excessive cloud permissions and violation of least privilege **Risk Level**: High ### Vulnerable Code ```bash hcloud IAM CreateAgencyCustomPolicy \ --role.display_name="policy_ai4s_llma4ad" \ --role.description="AI4S LLM4AD delegation policy" \ --role.description_cn="LLM4AD cross-service delegation policy" \ --role.type="AX" \ --role.policy.Version="1.1" \ --role.policy.Statement.1.Effect="Allow" \ --role.policy.Statement.1.Action.1="iam:agencies:assume" \ --role.policy.Statement.1.Action.2="obs:bucket:CreateBucket" \ --role.policy.Statement.1.Action.3="obs:bucket:DeleteBucket" \ --role.policy.Statement.1.Action.4="obs:bucket:DeleteBucketPolicy" \ --role.policy.Statement.1.Action.5="obs:bucket:GetBucketAcl" \ --role.policy.Statement.1.Action.6="obs:bucket:GetBucketLocation" \ --role.policy.Statement.1.Action.7="obs:bucket:GetBucketPolicy" \ --role.policy.Statement.1.Action.8="obs:bucket:GetBucketQuota" \ --role.policy.Statement.1.Action.9="obs:bucket:GetBucketStorage" \ --role.policy.Statement.1.Action.10="obs:bucket:GetBucketStoragePolicy" \ --role.policy.Statement.1.Action.11="obs:bucket:GetEncryptionConfiguration" \ --role.policy.Statement.1.Action.12="obs:bucket:HeadBucket" \ --role.policy.Statement.1.Action.13="obs:bucket:ListAllMyBuckets" \ --role.policy.Statement.1.Action.14="obs:bucket:ListBucket" \ --role.policy.Statement.1.Action.15="obs:bucket:ListBucketMultipartUploads" \ --role.policy.Statement.1.Action.16="obs:bucket:PutBucketAcl" \ --role.policy.Statement.1.Action.17="obs:bucket:PutBucketPolicy" \ --role.policy.Statement.1.Action.18="obs:bucket:PutBucketQuota" \ --role.policy.Statement.1.Action.19="obs:bucket:PutEncryptionConfiguration" \ --role.policy.Statement.1.Action.20="obs:bucket:PutLifecycleConfiguration" \ --role ...[truncated 4664 chars]
Remediation
## Remediation Suggestions 1. Replace the broad action list with the minimum operations required to upload and retrieve evolution results. Typically, this should be limited to necessary object upload, multipart-upload, and narrowly required listing operations. 2. Remove administrative actions that are not necessary for result upload, including: - `obs:bucket:CreateBucket` - `obs:bucket:DeleteBucket` - `obs:bucket:DeleteBucketPolicy` - `obs:bucket:PutBucketPolicy` - `obs:bucket:PutBucketAcl` - `obs:bucket:PutBucketQuota` - `obs:bucket:PutEncryptionConfiguration` - `obs:bucket:PutLifecycleConfiguration` - Object deletion and ACL-modification actions unless explicitly required. 3. Add an explicit resource restriction for the exact user-selected bucket and, where supported, its designated output prefix. 4. Add policy conditions preventing access to other buckets and prefixes, even if additional OBS actions are accidentally added later. 5. Replace `--agency.duration="FOREVER"` with the shortest duration that supports the requested task. 6. Document and automate post-task cleanup: revoke bucket authorization, detach the custom policy, and delete or disable the agency when it is no longer required. 7. Require the user to review and explicitly confirm the exact trusted principal, bucket, prefix, policy actions, and agency duration before creating the delegation. 8. Separate read, write, and destructive permissions so ordinary result upload never receives deletion or security-policy administration capabilities. 9. Validate the effective cloud policy after creation and fail closed if it is not resource-scoped to the selected bucket.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description presents a broad operational automation skill for Huawei Cloud LLM4AD lifecycle management through KooCLI, including backend resource operations and IAM configuration. The supplied code does none of those core actions. Instead, it only builds console URLs for task or algorithm pages and can optionally open them in a browser after checking for a graphical desktop environment. This is a materially different primary purpose. The browser/URL utility may be tangentially related to viewing results in a console, but it does not implement the declared lifecycle management capabilities, and it adds a GUI-opening behavior absent from the description. Therefore the description does not accurately represent the code chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
This is a clear description-behavior mismatch. The declared purpose presents a cloud automation skill for Huawei Cloud LLM4AD that performs operational lifecycle actions through KooCLI and IAM configuration. The actual code does none of that: it is a pure local utility for caching identifiers and timestamps in CSV files and deriving iteration values from commit IDs. While this helper may support a larger LLM4AD workflow, the provided code chunk by itself lacks the core declared capabilities and has a materially narrower primary purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared description presents a full-featured LLM4AD operational skill for Huawei Cloud, centered on lifecycle actions against algorithm design resources and IAM setup. The supplied code chunk does something materially narrower and different: it is an environment diagnostic script. Its actions are limited to local command existence checks, version/config inspection, region parsing, PATH adjustment, shell-warning output, and a simple OptVerse connectivity check using `hcloud OptVerse ListBuckets`. Those are supporting/preflight behaviors, but here they are the entirety of the provided code chunk, while the declared purpose claims operational lifecycle management capabilities that are absent. Because the actual code neither implements the main advertised functions nor matches the declared triggers around evolve-task actions, this is a clear description-behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description presents a full-featured Huawei Cloud LLM4AD automation skill centered on KooCLI operations and IAM configuration. The supplied code does not implement any of those cloud-facing behaviors. It only performs local filesystem traversal and ZIP creation, explicitly stating it does not call `hcloud` and that its output is merely suitable as input to a later `hcloud ... ImportAlgorithmFile` command. This is not just a supporting detail of the declared lifecycle skill; it is a materially narrower and different primary purpose: local packaging only. Therefore the description does not accurately represent the actual code behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description presents a cloud-automation skill for Huawei Cloud LLM4AD operations through the `hcloud` CLI, including both evolution workflow management and IAM configuration. The actual code chunk does not implement any of those capabilities. Instead, it is merely a local Python source template demonstrating how to mark an algorithm function for later evolution, with a trivial sorting function as placeholder logic. This is a material description-behavior mismatch because the primary purpose and capabilities of the supplied code are entirely different from the declared operational cloud-management functionality.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description promises a full-featured Huawei Cloud LLM4AD operational skill centered on `hcloud`/KooCLI and IAM actions. The actual code chunk is only a local baseline-function template used as an evaluator stub, with placeholder scoring logic. Its primary purpose is materially different from the declared lifecycle automation behavior, and none of the described cloud-management capabilities are implemented in this code.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description says the skill manages the full Huawei Cloud LLM4AD workflow via KooCLI, including cloud project/task operations and IAM configuration. The supplied code does none of that. It is only a minimal evaluator function template for benchmarking a candidate sorting function by timing it on random data. This is a materially different primary purpose and omits essentially all declared cloud-management capabilities, so the description does not accurately represent the code chunk.

Ae1

High
Category
analysis-evasion
Content
-dirs by role): references describe; scripts execute local-only helpers (excl. `scripts/readme.md`); templates supply uploadable source.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
-dirs by role): references describe; scripts execute local-only helpers (excl. `scripts/readme.md`); templates supply uploadable source.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
If `precheck.sh` / `precheck.ps1` cannot run, see [`references/prerequisites.md`](references/prerequisites.md) §2.1 "5-line manual probe" for the 5 manual verif
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
If `precheck.sh` / `precheck.ps1` cannot run, see [`references/prerequisites.md`](references/prerequisites.md) §2.1 "5-line manual probe" for the 5 manual verif
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
> Full install / credentials / network verification, see [`references/cli-installation-guide.md`](references/cli-installation-guide.md). Quick verify: `hcloud v
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Hidden Instructions

High
Category
Prompt Injection
Content
#!/usr/bin/env powershell
# precheck.ps1 — PowerShell 版本的统一环境检查脚本
# 用法: skill action=exec, command ["powershell", "skill://scripts/precheck.ps1"]
# 退出码: 0=全部通过, 1=有检查未通过
Confidence
60% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill explicitly instructs the agent to execute shell commands, read configuration, and write cache files, but it does not declare any tool scope such as allowed-tools or permissions. That creates an authorization gap where a runtime may grant broader capabilities than users expect, increasing the risk of unintended command execution or local file access when the skill is invoked.

External Transmission

Medium
Category
Data Exfiltration
Content
| ❌ Anti-pattern | Why it's bad |
|---|---|
| `requests.post('https://optverse...', json=...)` direct to OpenAPI | Bypasses KooCLI auth / error handling / retry / `--debug` logging; crosses the "direct OpenAPI" red line |
| `--key value` space-separated | bash splits it as `--key=` (empty value) + `value` (independent token); PowerShell `$VAR` doesn't expand |
| `python -c "import subprocess; ..."` self-forking hcloud | Bypasses agent-framework isolation / cache semantics; inconsistent with Skill Runtime's script-call mechanism |
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
| ❌ Anti-pattern | Why it's bad |
|---|---|
| `requests.post('https://optverse...', json=...)` direct to OpenAPI | Bypasses KooCLI auth / error handling / retry / `--debug` logging; crosses the "direct OpenAPI" red line |
| `--key value` space-separated | bash splits it as `--key=` (empty value) + `value` (independent token); PowerShell `$VAR` doesn't expand |
| `python -c "import subprocess; ..."` self-forking hcloud | Bypasses agent-framework isolation / cache semantics; inconsistent with Skill Runtime's script-call mechanism |
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
When starting a task, the agent decides where each parameter comes from by following the three categories below — **first fill from A, then collect from B, finally cover with C defaults**.

### 8.1 A. Pre-configured (Agent retrieves automatically, do NOT ask user)

| Parameter | Source |
|---|---|
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.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
# Download the release binary (verify the URL against the official Huawei Cloud docs)
curl -L -o /tmp/hcloud.tar.gz "<official-hcloud-release-url>"
tar -xzf /tmp/hcloud.tar.gz -C /tmp
sudo mv /tmp/hcloud /usr/local/bin/hcloud
hcloud version
```
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The document instructs users on creating, updating, deleting, and attaching IAM agencies and policies, as well as authorizing bucket access, without a prominent warning that these actions modify account access control and may grant backend services persistent access to cloud storage. In a skill that automates cloud algorithm workflows, this can lead to overbroad permission grants or accidental security posture changes by operators who follow the instructions verbatim.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
Lines L097-L098 state that creating agencies and policies is the ops account's job and that sub-accounts do not need `iam:agencies:*` or `iam:roles:*` actions. However, L104-L119 immediately provides a `hcloud IAM CreateCloudServiceCustomPolicy` command template for skill use, which contradicts the preceding guidance about who should perform IAM policy creation.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This markdown file includes remediation steps that tell users to replace a command with `rm -rf <output-directory>` and later to run `rm -rf <output-directory>` directly. Those commands can recursively delete files, but the document provides no warning about verifying the target path or the destructive nature of the operation.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The module docstring, CLI help text, and runtime status messages are presented in Chinese only, which imposes a specific language on users. The file does not offer any language selection or explain that the tool is intentionally limited to a Chinese-speaking or region-specific audience.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
try:
            session_name = os.environ.get("SESSIONNAME", "Console")
            if session_name == "Services" or session_name == "":
                result = subprocess.run(
                    ["tasklist", "/FI", "IMAGENAME eq explorer.exe"],
                    capture_output=True, text=True, timeout=5
                )
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
if system == "Windows":
            os.startfile(url)  # type: ignore
        elif system == "Darwin":
            subprocess.run(["open", url], check=True, timeout=10)
        else:
            for cmd in ["xdg-open", "gnome-open", "kfmclient"]:
                if shutil.which(cmd):
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
else:
            for cmd in ["xdg-open", "gnome-open", "kfmclient"]:
                if shutil.which(cmd):
                    subprocess.run([cmd, url], check=True, timeout=10)
                    return
            webbrowser.open(url)
    except Exception:
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Static analysis

No suspicious patterns detected.