Back to skill

Security audit

huawei-cloud-flexus-l-server-hermes-deployment

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real Hermes deployment/configuration tool, but it under-discloses billing, access-control, and secret-retention risks that users should review before installing.

Install only if you are comfortable granting Huawei Cloud credentials that can create and operate instances and COC scripts. Use a dedicated, least-privilege, temporary credential; avoid command-line secrets; review and disable auto-renew/auto-pay if unwanted; restrict Feishu/WeCom allowed users after channel setup; and rotate any bot secrets previously used through this version.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/lib.py:547
Finding

Channel Configuration Opens Hermes Gateway to All Messaging-Platform Users

Content
View full analysis

Vulnerability Details

File Location: scripts/lib.py:547-557
Vulnerability Type: Insecure access-control configuration
Risk Level: High

sh
if [ "$BOT_PLATFORM" = "feishu" ]; then
    echo "Configuring Feishu channel..."
    set_env_variable "$ENV_PATH" "FEISHU_APP_ID" "$FEISHU_APP_ID"
    set_env_variable "$ENV_PATH" "FEISHU_APP_SECRET" "$FEISHU_APP_SECRET"
    set_env_variable "$ENV_PATH" "FEISHU_DOMAIN" "feishu"
    set_env_variable "$ENV_PATH" "FEISHU_CONNECTION_MODE" "websocket"
    set_env_variable "$ENV_PATH" "FEISHU_ALLOW_ALL_USERS" "true"
    set_env_variable "$ENV_PATH" "FEISHU_ALLOWED_USERS" ""
    set_env_variable "$ENV_PATH" "FEISHU_GROUP_POLICY" "open"
    set_env_variable "$ENV_PATH" "GATEWAY_ALLOW_ALL_USERS" "true"
    echo "✅ Feishu configuration written successfully"

elif [ "$BOT_PLATFORM" = "wecom" ]; then
    echo "Configuring WeCom channel..."
    set_env_variable "$ENV_PATH" "WECOM_BOT_ID" "$WECOM_BOT_ID"
    set_env_variable "$ENV_PATH" "WECOM_SECRET" "$WECOM_SECRET"
    set_env_variable "$ENV_PATH" "GATEWAY_ALLOW_ALL_USERS" "true"

Technical Analysis

The remote channel-installation script explicitly enables unrestricted gateway access for both supported platforms. The Feishu branch additionally clears the user allowlist and configures an open group policy.

These settings are applied automatically whenever install_channel_remote() creates and executes the channel configuration script. The confirmation at scripts/channels.py:134-138 only asks the user to confirm the general configuration; it does not disclose that the gateway will accept all users or provide an option to configure an allowlist.

This behavior crosses an authorization boundary because configuring a bot integration does not inherently authorize every messaging-platform user to access the deployed agent. The generated configuration expands access beyond the bot credentials and target platform selected by the operator.

Attack Path

  1. The ...[truncated 1089 chars]
Remediation
View remediation

Remediation Suggestions

  • Default all channel and gateway access controls to deny:
    • FEISHU_ALLOW_ALL_USERS=false
    • GATEWAY_ALLOW_ALL_USERS=false
    • A restrictive group policy
  • Require an explicit user or group allowlist during channel configuration.
  • Add dedicated CLI options such as --allowed-user and --allowed-group.
  • If unrestricted access is required, expose it through an explicit option such as --allow-all-users; do not enable it implicitly.
  • Display the resulting authorization policy before confirmation.
  • Require a separate confirmation for unrestricted access, including in automated workflows through an explicit flag.
  • Validate the effective gateway policy after writing the configuration and fail closed if no allowlist is present.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/lib.py:747
Finding

Bot Secrets Are Embedded in Persistent Huawei COC Script Source

Content
View full analysis

Vulnerability Details

File Location: scripts/lib.py:747-773
Vulnerability Type: Plaintext secret exposure in cloud script definitions
Risk Level: Medium

python
script_info = HERMES_SCRIPT_TEMPLATES["install_channel"]

# Replace variables in template
content = script_info["content"]
content = content.replace("${bot_platform}", bot_platform if bot_platform else "")
content = content.replace("${feishu_app_id}", feishu_app_id if feishu_app_id else "")
# Inject secrets via exported environment variables (avoid hardcoded secret values in script)
env_exports = ""
if feishu_app_secret:
    env_exports += f"export FEISHU_APP_SECRET='{feishu_app_secret}'\n"
if wecom_secret:
    env_exports += f"export WECOM_SECRET='{wecom_secret}'\n"
if env_exports:
    content = env_exports + content
content = content.replace("${wecom_bot_id}", wecom_bot_id if wecom_bot_id else "")

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

Technical Analysis

The implementation claims that bot secrets are passed through environment variables, but it constructs those environment variables by prepending plaintext export commands to the script source. The complete source, including the secret, is then submitted to Huawei COC through create_script().

Consequently, the Feishu application secret or WeCom secret becomes part of a cloud control-plane script definition rather than remaining an ephemeral execution parameter. The audited execution path does not delete the created script after execution or on failure.

This unnecessarily expands the secret’s exposure from the selected Hermes instance to COC script storage and to cloud principals able to retrieve script definitions. It also increases retention beyond ...[truncated 1154 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not include secrets in COC script content.
  • Use a dedicated encrypted secret-parameter or secret-reference mechanism supported by the execution platform.
  • Ensure secret values are injected only into the execution environment and are not retained in script definitions, command histories, logs, or execution metadata.
  • If the platform cannot provide ephemeral secret parameters:
    • Use a narrowly scoped secret service.
    • Have the target instance retrieve the secret using a short-lived identity.
    • Avoid returning the secret in command output.
  • Add guaranteed cleanup in a finally-equivalent path so temporary script artifacts are removed after success or failure.
  • Restrict script-detail permissions to the minimum necessary principals.
  • Rotate any Feishu or WeCom secrets previously processed through this implementation.

other

Warning
Location
scripts/lib.py:220
Finding

Instance Deployment Silently Enables Automatic Payment and Renewal

Content
View full analysis

Vulnerability Details

File Location: scripts/lib.py:220-234
Vulnerability Type: Undisclosed recurring billing authorization
Risk Level: Medium

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

The confirmation displayed by scripts/deploy.py:84-99 does not disclose these billing settings:

python
print(f"\nDeployment Configuration:")
print(f"  Instance Name: {instance_name or 'Auto-generated'}")
print(f"  Target Region: {region} ({region_name})")

# Confirm deployment (skip in non-interactive mode)
non_interactive = getattr(args, 'non_interactive', False)
if not non_interactive:
    confirm = prompt_for_input(
        "Confirm deployment?",
        required=False,
        default="y",
        choices=["y", "n"]
    )
    if confirm.lower() != "y":
        print("\nDeployment cancelled")
        return
else:
    print("  Non-interactive mode: Auto-confirm")

Technical Analysis

Every deployment request purchases a prepaid one-month instance and unconditionally enables both automatic payment and automatic renewal. Neither behavior is configurable through the CLI.

Interactive users are shown only the instance name and region before confirmation. Non-interactive mode skips confirmation entirely and is described as automatically confirmed. Although SKILL.md generally states that cloud resources incur costs, it does not make the recurring renewal behavior part of the deployment confirmation.

Authorization to create the requested resour ...[truncated 1143 chars]

Remediation
View remediation

Remediation Suggestions

  • Set is_auto_renew to False by default.
  • Expose recurring billing only through an explicit option such as --auto-renew.
  • Display the following before confirmation:
    • Charging mode
    • Billing period
    • Resource quantities
    • Automatic payment status
    • Automatic renewal status
    • Available price information
  • Require a separate affirmative confirmation for automatic renewal.
  • In non-interactive mode, require an explicit billing-authorization flag rather than treating --non-interactive as consent to recurring charges.
  • Provide instructions for disabling renewal and identifying the resulting cloud order after deployment.
Vulnerability Patterns
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (48)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code clearly matches the deployment portion of the description: it gathers Huawei Cloud credentials, prompts for instance name and region, confirms deployment, and invokes create_hermes_instance. However, the declared purpose claims broader functionality—specifically ModelArts large model configuration, robot channel configuration, and a complete deployment/configuration workflow. None of those configuration capabilities appear in this code chunk. Because the described skill materially overstates the implemented functionality shown here, this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied code does not perform one-click deployment, ModelArts configuration, or robot channel configuration. Its sole purpose is to restart the Hermes gateway remotely on a Huawei Cloud Flexus L instance using provided AK/SK credentials and resource identifiers. Restarting a gateway is a distinct operational capability and materially different from the declared deployment/configuration workflow. While it is related to Hermes on Huawei Cloud, the code’s primary behavior is not accurately represented by the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents this skill as an operational deployment/configuration tool for Hermes. However, the provided code chunk is only a smoke test suite. It imports local modules, checks that constants and helper functions exist, verifies required files are present, and ensures embedded script content contains expected strings. There is no evidence of cloud API usage, installation steps, instance setup, model configuration, or channel configuration. This is a material purpose mismatch: the code is test/QA infrastructure for the skill package, not the deployment workflow described.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents the skill as a deployment and configuration workflow for Hermes, triggered by actions like deploying Hermes or configuring models/channels. The supplied code does not deploy Hermes or configure ModelArts or robot channels. Instead, it is a status-check utility for querying UniAgent state on a Huawei Cloud Flexus L instance using provided credentials and a resource ID. This is a materially different primary purpose from the declared description, so it should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This example requires AK, SK, and an API key to be supplied as command-line parameters, multiplying the exposure surface for multiple secrets at once. These values can be captured by local users, monitoring agents, shell history, or CI/CD logs, and the skill context makes this especially dangerous because the credentials enable cloud control-plane actions and model service access.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The channel configuration example exposes both cloud credentials and third-party bot secrets on the command line, creating risk of compromise across multiple systems. If leaked, an attacker could gain access to Huawei Cloud resources and the Feishu bot integration, enabling unauthorized configuration changes, data access, or impersonation through the messaging channel.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The library provides broad COC primitives to create, retrieve, list, and execute arbitrary scripts on remote instances. In an agent skill, that is effectively a general-purpose remote code execution surface beyond the declared deployment scope, and it can be repurposed to run unintended commands on managed infrastructure.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill documents capabilities to execute shell commands, use environment-provided credentials, interact with files, and call external cloud services, but it does not declare any explicit tool scope such as allowed-tools or permissions. That creates an overbroad trust boundary where an orchestrator may grant more capability than users expect, increasing the blast radius of prompt injection or misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation repeatedly shows AK/SK, security tokens, API keys, and app secrets passed directly as command-line arguments. Command-line secrets are commonly exposed through shell history, process listings, logs, CI output, and telemetry, so these examples normalize an unsafe handling pattern for highly sensitive credentials.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file is in scope for vague-trigger checks, and the acceptance criterion says the skill triggers on 'Deploy Hermes', 'Install Hermes', 'etc.' The 'etc.' leaves the trigger set open-ended and does not define exclusions or boundaries, which makes activation conditions ambiguous and more likely to overlap with ordinary user requests.

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 · references/cli-installation-guide.md (reported line 26)May include surrounding context.

bash
# Add repository and install
wget -q https://huaweicloud.com/hcloud/cli/latest/hcloud.list -O /tmp/hcloud.list
sudo mv /tmp/hcloud.list /etc/apt/sources.list.d/hcloud.list
sudo apt-get update
sudo apt-get install huaweicloud-cli

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

bash
# Add repository and install
wget -q https://huaweicloud.com/hcloud/cli/latest/hcloud.list -O /tmp/hcloud.list
sudo mv /tmp/hcloud.list /etc/apt/sources.list.d/hcloud.list
sudo apt-get update
sudo apt-get install huaweicloud-cli

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

md
# Add repository and install
wget -q https://huaweicloud.com/hcloud/cli/latest/hcloud.list -O /tmp/hcloud.list
sudo mv /tmp/hcloud.list /etc/apt/sources.list.d/hcloud.list
sudo apt-get update
sudo apt-get install huaweicloud-cli

# Verify installation

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

md
# Add repository and install
wget -q https://huaweicloud.com/hcloud/cli/latest/hcloud.list -O /tmp/hcloud.list
sudo mv /tmp/hcloud.list /etc/apt/sources.list.d/hcloud.list
sudo apt-get update
sudo apt-get install huaweicloud-cli

# Verify installation

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

python
# Add repository and install
wget -q https://huaweicloud.com/hcloud/cli/latest/hcloud.list -O /tmp/hcloud.list
sudo mv /tmp/hcloud.list /etc/apt/sources.list.d/hcloud.list
sudo apt-get update
sudo apt-get install huaweicloud-cli

# Verify installation

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

python
# Add repository and install
wget -q https://huaweicloud.com/hcloud/cli/latest/hcloud.list -O /tmp/hcloud.list
sudo mv /tmp/hcloud.list /etc/apt/sources.list.d/hcloud.list
sudo apt-get update
sudo apt-get install huaweicloud-cli

# Verify installation

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

python
# Add repository and install
wget -q https://huaweicloud.com/hcloud/cli/latest/hcloud.list -O /tmp/hcloud.list
sudo mv /tmp/hcloud.list /etc/apt/sources.list.d/hcloud.list
sudo apt-get update
sudo apt-get install huaweicloud-cli

# Verify installation

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

python
# Add repository and install
wget -q https://huaweicloud.com/hcloud/cli/latest/hcloud.list -O /tmp/hcloud.list
sudo mv /tmp/hcloud.list /etc/apt/sources.list.d/hcloud.list
sudo apt-get update
sudo apt-get install huaweicloud-cli

# Verify installation

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document recommends a combined IAM policy that grants wildcard resource access for instance creation/deletion and script creation/execution/deletion. In the context of a one-click deployment skill, this can normalize over-privileged access and enable destructive or arbitrary operational actions if the account, AK/SK, or workflow is misused or compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation instructs users to pass cloud access keys directly on the command line, which commonly exposes secrets through shell history, process listings, audit logs, CI logs, and terminal recording tools. In a deployment skill for cloud infrastructure, these credentials are highly sensitive and could allow unauthorized provisioning, modification, or access to cloud resources if leaked.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The automation guidance normalizes passing AK/SK via command-line arguments and explicitly reiterates that approach without warning about credential leakage. In scripted environments this is particularly risky because secrets may be stored in build logs, orchestration metadata, or shared shell history, increasing the chance of broad exposure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes this skill as a one-click deployment and configuration workflow for Hermes, specifically covering deployment, ModelArts configuration, and robot channel configuration. This file also imports and exposes gateway restart and execution/agent-status query capabilities, which are operational management functions not mentioned in the stated skill description or trigger scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The menu includes options to restart the Hermes Gateway, query COC script execution results, and query UniAgent status. These behaviors extend beyond the manifest’s declared deployment, model configuration, and channel configuration workflow, creating a user-facing mismatch between what the skill claims to do and what it actually offers.

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

python
deploy_parser.add_argument('--name', help='Instance name (optional, auto-generated by default)')
    deploy_parser.add_argument('--region', choices=REGION_IDS, help='Region ID (optional, default cn-north-4)')
    deploy_parser.add_argument('--cli-region', dest='region', choices=REGION_IDS, help='Region ID via --cli-region format (optional, alias for --region)')
    deploy_parser.add_argument('--non-interactive', action='store_true', help='Non-interactive mode, execute without confirmation')

    maas_parser = subparsers.add_parser('maas', help='Configure ModelArts large model on deployed Hermes instance')
    maas_parser.add_argument('--ak', help='Huawei Cloud AK (supports both long-term and temporary AK, optional, will prompt for input if not provided)')

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

python
deploy_parser.add_argument('--name', help='Instance name (optional, auto-generated by default)')
    deploy_parser.add_argument('--region', choices=REGION_IDS, help='Region ID (optional, default cn-north-4)')
    deploy_parser.add_argument('--cli-region', dest='region', choices=REGION_IDS, help='Region ID via --cli-region format (optional, alias for --region)')
    deploy_parser.add_argument('--non-interactive', action='store_true', help='Non-interactive mode, execute without confirmation')

    maas_parser = subparsers.add_parser('maas', help='Configure ModelArts large model on deployed Hermes instance')
    maas_parser.add_argument('--ak', help='Huawei Cloud AK (supports both long-term and temporary AK, optional, will prompt for input if not provided)')