Back to skill

Security audit

huawei-cloud-flexus-l-server-flexusagent-deployment

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its cloud deployment purpose, but it under-discloses several high-impact behaviors involving billing, public network exposure, and administrator password handling.

Review carefully before installing. Use a test cloud account or tightly scoped temporary credentials, expect real charges, verify and disable auto-renew/auto-pay if not wanted, check the security group after deployment, and avoid putting admin passwords on command lines or in chat logs. Rotate any password that may have been printed or embedded in retained COC scripts.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/passwd.py:87
Finding

Administrator Password Disclosed Through Standard Output and Agent Conversation

Content
View full analysis

Vulnerability Details

File Location: scripts/passwd.py:87-96; related instruction at SKILL.md:267-268
Vulnerability Type: Plaintext credential disclosure
Risk Level: High

Vulnerable Code and Instructions

python
if not admin_password:
    print("\nNew FlexusAgent admin password")
    admin_password = prompt_for_input(
        "New FlexusAgent admin password (required)",
        required=True
    )

print(f"  Resource ID: {resource_id}")
print(f"  Region: {region_id}")
print(f"  Admin Password: {admin_password}")
print(f"  Timeout: {timeout} seconds")

The Skill instructions additionally require the Agent to disclose the new password:

markdown
> **Mandatory Constraint**: After changing password, reply:
> `"Web UI: http://<public-ip>:80; Login email: super@dify.com, Password: <new-password>"`

Technical Analysis

The password-change workflow obtains a new FlexusAgent administrator password from a command-line argument or interactive input. The script then writes the complete plaintext value to standard output.

This behavior contradicts the Skill's own security rules prohibiting credential output. Standard output may be retained by Agent execution infrastructure, terminal history capture, CI/CD logs, monitoring systems, or other logging facilities. The instruction in SKILL.md further requires the Agent to repeat the password in the conversation, placing it in persistent conversation records.

The interactive prompt also omits hide_input=True, so password entry may be displayed directly in an interactive terminal.

The trust boundary crossed is between transient secret input intended for the FlexusAgent administrator account and persistent or broadly accessible execution and conversation records.

Attack Path

  1. A user invokes the passwd command and supplies a new administrator password.
  2. do_change_flexusagent_admin_password() stores the password in admin_password.
  3. Line 96 prints the complete value to ...[truncated 889 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the plaintext password output entirely:
python
print("  Admin Password: [REDACTED]")
  1. Collect interactive passwords using hidden input:
python
admin_password = prompt_for_input(
    "New FlexusAgent admin password (required)",
    required=True,
    hide_input=True,
)
  1. Remove the SKILL.md requirement to return the password in the conversation. Return only a success message and the Web UI address.
  2. Never include passwords in exceptions, execution output, telemetry, or debug logs.
  3. Prefer a secure secret-delivery mechanism that allows the user to set or retrieve the password without exposing it to the Agent transcript.
  4. Review and purge existing execution logs and conversation records that may contain previously disclosed passwords, subject to applicable retention controls.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/lib.py:1346
Finding

Administrator Passwords Persist in Reusable Huawei COC Script Source

Content
View full analysis

Vulnerability Details

File Location: scripts/lib.py:1346-1358 and scripts/lib.py:1472-1484
Vulnerability Type: Persistent plaintext credential storage
Risk Level: High

Vulnerable Code

Password-change workflow:

python
script_info = SCRIPT_TEMPLATES["change_password"]

content = script_info["content"].replace("${adminPassword}", admin_password)

create_result = coc_create_script(
    name=f"{script_info['name']}-{int(time.time())}",
    script_type=script_info["type"],
    content=content,
    description=script_info["description"],
    risk_level=script_info["risk_level"],
    ak=ak,
    sk=sk,
    security_token=security_token,
)

Workflow-import path:

python
print("\nCreating COC script...")
script_info = SCRIPT_TEMPLATES["import_dify_app_workflow"]

content = script_info["content"].replace(
    "${base64String}", base64_string
).replace(
    "${dify_admin_password}", flexusagent_password
)

create_result = coc_create_script(
    name=f"{script_info['name']}-{int(time.time())}",
    script_type=script_info["type"],
    content=content,
    description=script_info["description"],
    risk_level=script_info["risk_level"],
    ak=ak,
    sk=sk,
    security_token=security_token,
)

The password-change template embeds the substituted value in shell source:

bash
NEW_DIFY_ADMIN_PASSWORD="${adminPassword}"

The workflow-import template similarly embeds the administrator password:

bash
RAW_PASSWORD="${dify_admin_password}"

Technical Analysis

Both execution paths substitute an administrator password directly into shell-script source and upload that source through coc_create_script(). The created COC script is then referenced by UUID and executed on the selected cloud instance.

No reviewed cleanup path deletes the COC script after execution. Consequently, the secret is converted from transient input into persistent cloud control-plane data. Base64 encoding elsewhere in the workflow does not protect the pa ...[truncated 1692 chars]

Remediation
View remediation

Remediation Suggestions

  1. Do not place credentials in script source.
  2. Use a dedicated encrypted COC secret or runtime parameter mechanism that prevents secrets from appearing in stored script definitions.
  3. If the platform offers no secure parameter channel:
    • Create a narrowly scoped, single-use secret.
    • Limit access to the generated script.
    • Delete the script in a finally block immediately after execution.
    • Verify that deletion succeeded.
    • Rotate the password if cleanup fails.
  4. Avoid placing secrets in process arguments, execution logs, command output, or exception messages.
  5. Use short-lived credentials where possible and rotate any administrator passwords previously embedded in retained scripts.
  6. Add automated tests that inspect generated COC script content and fail if known secret values appear.
  7. Apply least-privilege IAM policies so unrelated principals cannot list or read COC script source.

other

Warning
Location
scripts/lib.py:204
Finding

Deployment Enables Undisclosed Automatic Renewal and Automatic Payment

Content
View full analysis

Vulnerability Details

File Location: scripts/lib.py:204-218
Vulnerability Type: Unauthorized recurring billing configuration
Risk Level: Medium

Vulnerable Code

python
request_body = {
    "instance_name": instance_name,
    "plan_spec": plan_spec,
    "image_ref": {
        "image_name": "FlexusAgent",
        "image_version": "1.7.1",
        "product_id": FLEXUSAGENT_PRODUCT_UUID
    },
    "region": target_region,
    "charging_mode": "prePaid",
    "period_type": "month",
    "period_num": 1,
    "purchase_quantity": 1,
    "description": "FlexusAgent one-click deployment",
    "is_auto_renew": True,
    "is_auto_pay": True,
    "extra_resources": [
        {"type": "evs", "size": 50},
        {"type": "cbr", "size": 50},
        {"type": "hss"}
    ]
}

Technical Analysis

The deployment request creates a prepaid resource for one month but unconditionally enables both automatic renewal and automatic payment. These settings are not exposed as CLI parameters, and the deployment confirmation only confirms the deployment configuration presented by deploy.py, which displays the instance name, region, and specification.

The reviewed Skill documentation warns that deployment incurs costs and describes billing as prepaid, but it does not disclose that future renewals and payments are automatically enabled. Therefore, confirmation to create the initial instance is expanded into authorization for recurring future charges.

The trust boundary crossed is the user's approval for the immediate deployment and initial billing period versus continuing financial authorization for subsequent renewal periods.

Attack Path

  1. A user asks the Skill to deploy a FlexusAgent instance.
  2. The Skill displays the instance name, region, and specification and requests deployment confirmation.
  3. The user confirms the immediate deployment without being shown automatic-renewal or automatic-payment settings.
  4. create_flexusagent_instance() subm ...[truncated 695 chars]
Remediation
View remediation

Remediation Suggestions

  1. Change the secure defaults to:
python
"is_auto_renew": False,
"is_auto_pay": False,
  1. Add explicit CLI options such as --auto-renew and --auto-pay, defaulting to disabled.
  2. Before enabling either option, display:
    • The renewal period.
    • The resources subject to renewal.
    • That future charges will occur automatically.
    • Instructions for disabling renewal.
  3. Require a separate affirmative confirmation specifically for recurring billing; do not treat the generic deployment confirmation as sufficient.
  4. Include the final values of is_auto_renew and is_auto_pay in the deployment summary before submitting the API request.
  5. In non-interactive mode, require explicit flags rather than silently enabling recurring billing.
  6. Update SKILL.md and verification documentation to accurately describe automatic renewal and payment behavior.
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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (48)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding indicates the skill may do more than its headline claims, including opening ingress rules, searching/installing plugins, and creating/executing remote scripts via COC. Those are materially higher-risk actions than simple deployment guidance because they can expose services to the internet, alter target systems, and execute arbitrary code remotely.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding indicates the skill may do more than its headline claims, including opening ingress rules, searching/installing plugins, and creating/executing remote scripts via COC. Those are materially higher-risk actions than simple deployment guidance because they can expose services to the internet, alter target systems, and execute arbitrary code remotely.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding indicates the skill may do more than its headline claims, including opening ingress rules, searching/installing plugins, and creating/executing remote scripts via COC. Those are materially higher-risk actions than simple deployment guidance because they can expose services to the internet, alter target systems, and execute arbitrary code remotely.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The instruction to reveal the newly set administrator password directly in the assistant reply is a concrete secret-handling flaw. In this context, the password grants access to an internet-reachable admin interface, so disclosure could immediately enable account compromise if chat logs, observers, or integrations can read the response.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| [iam-policies.md](references/iam-policies.md) | IAM permission policies |

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The admin password reset workflow performs disruptive actions including package installation, environment-file modification, Docker restarts, and Redis FLUSHALL without clear disclosure. Because it runs remotely as root on the target instance, misuse can cause outage, invalidate sessions, or destroy runtime state.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/lib.py (reported line 1140)May include surrounding context.

python
if ! command -v jq &>/dev/null; then
    sudo apt-get update -qq
    sudo apt-get install -y -qq jq 2>/dev/null ||
        sudo yum install -y -q jq 2>/dev/null
fi

Missing User Warnings

High
Category
Not specified by scanner
Confidence
94% confidence
Finding

The wrapper function presents itself as a password-change helper but triggers remote execution of a script with significant hidden side effects on a target instance. That mismatch between user expectation and actual behavior makes accidental destructive changes more likely and increases operational risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill can modify VPC security groups and create ingress rules with permissive defaults like 0.0.0.0/0, which can expose services to the public Internet. In a deployment/password/workflow skill, this materially increases attack surface and can lead to unauthorized access if invoked incorrectly or abused.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares and documents capabilities that use shell execution, network access, and environment-derived credentials, but it does not define an explicit tool scope such as allowed-tools or permissions. In a deployment skill that can create cloud resources and modify remote systems, missing capability scoping increases the chance of unintended or overly broad execution beyond what users expect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The confirmation instructions require the user to reply with specific English words: "confirm" or "yes". This is a natural-language locale policy issue because the skill also contains Chinese content but does not offer users a language choice or localized confirmation alternatives.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
84% confidence
Finding

The skill recommends that after deployment, the agent automatically executes a sequence of privileged follow-up operations, including querying instance details and changing the admin password. Even though it mentions user agreement, bundling multiple state-changing actions into an automated chain raises the risk of unintended modifications on paid cloud resources and administrative systems.

Content

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

md
**Execution Order Recommendation**:
1. After deployment completes, **immediately ask user whether to change password (step 2)**
2. After user agrees, AI Agent automatically executes: query instance details → change password → return access information
3. After password change, ask user whether to integrate MaaS model (step 3)
4. If quick AI application deployment is needed, guide user to view and import workflows (steps 4, 5)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The documented auto-execution of sub-steps for querying instance details and then changing the password reduces operator control over sensitive administrative actions. In a cloud admin skill, even a small amount of autonomy can have outsized consequences because it affects credentials, access paths, and potentially billable resources.

Content

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

md
### 2️⃣ Change Admin Password and Get Instance Details (Required)

**⚠️ Important Note**: This step includes two auto-executed sub-steps: First query instance details to get floating IP and resource ID, then change admin password.

**Change Password & Query Instance Details**

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill's security rules say credentials and sensitive values must never be exposed, yet the password-change section requires returning the newly set admin password verbatim. Revealing a newly configured administrator password in conversation creates a direct secret-disclosure path through logs, transcripts, UI history, or downstream monitoring systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation instructs users to pass highly sensitive cloud credentials, security tokens, API keys, and administrator passwords directly on the command line while also performing live deployment and password-change operations. This is dangerous because command-line arguments can be exposed through shell history, process listings, logs, CI output, and screenshots, and the document does not warn users about secret handling or the operational impact of modifying real cloud resources.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script collects a FlexusAgent admin email and password, then transmits them to a remote workflow import function tied to a cloud instance, but it does not clearly warn the user that these secrets will be used remotely or may appear in remote execution contexts, logs, or process arguments. In an infrastructure-management skill, this behavior is expected operationally, but the lack of explicit disclosure and safer secret-handling increases the risk of inadvertent credential exposure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes deployment, password management, MaaS configuration, and workflow viewing/import, but this file also documents and implements a separate 'query-instance' command for retrieving instance details such as floating IP. That capability is broader infrastructure inspection functionality and is not reflected in the stated skill description or trigger set.

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

python
maas_parser.add_argument('--flexusagent-email', type=str, help='FlexusAgent admin email')
    maas_parser.add_argument('--flexusagent-password', type=str, help='FlexusAgent admin password')
    maas_parser.add_argument('--maas-api-key', type=str, help='ModelArts MaaS API Key')
    maas_parser.add_argument('--non-interactive', action='store_true', help='Non-interactive mode, execute without confirmation')

    import_workflow_parser = subparsers.add_parser('import-app-workflow', help='Import Dify app workflow to FlexusAgent instance')
    import_workflow_parser.add_argument('--resource-id', help='L Instance Resource ID')

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

python
print("\nDeployment cancelled")
            return
    else:
        print("  Non-interactive mode: Auto-confirm")

    # Execute deployment
    print("\nCreating FlexusAgent instance...")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

After reporting successful instance creation, the script automatically calls do_set_security_group_rule() without presenting what rules will be added or asking for a separate confirmation. In a cloud deployment skill, silent network exposure can unintentionally open management or application ports to broad sources, increasing the attack surface of the newly created host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The coc_execute_script function executes a specified script on remote instances, which is a safety-critical subprocess/remote-command operation. Although the docstring explains parameters, it does not clearly warn users that this will run code on target machines, and there is no confirmation prompt or explicit user disclosure in the function behavior itself.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lib.py (reported line 595)May include surrounding context.

python
if not data:
                # Query failed, log and continue
                error_msg = query_result.get("error", {}).get("message", "Unknown error") if isinstance(query_result,
                                                                                                   dict) else "Query failed"
                print(f"Failed to query execution status: {error_msg}")
                time.sleep(wait_interval)
                elapsed_time += wait_interval

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented password-change script does more than reset an admin password: it edits Dify configuration, restarts Docker services, and flushes Redis with FLUSHALL. Those side effects are destructive and exceed the stated operation, creating risk of service disruption, cache/session loss, and surprising system changes.

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

python
BASE64_PARAM="${base64String}"

if ! command -v jq &>/dev/null; then
    sudo apt-get update -qq
    sudo apt-get install -y -qq jq 2>/dev/null ||
        sudo yum install -y -q jq 2>/dev/null
fi

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

python
BASE64_PARAM="${base64String}"

if ! command -v jq &>/dev/null; then
    sudo apt-get update -qq
    sudo apt-get install -y -qq jq 2>/dev/null ||
        sudo yum install -y -q jq 2>/dev/null
fi