Back to skill

Security audit

huawei-cloud-ecs-vulnerability-auditor

Security checks for vulnerabilities and agentic risk

Overview

This auditor needs review because its collector can execute untrusted programs as root and leaves broad cloud permissions active after scanning.

Request a corrected collector before production use: it must avoid executing untrusted binaries as root. Have an administrator review the agency's permissions and lifetime; normal cleanup does not revoke them. Confirm that software-name queries and inventory logging are acceptable, verify the CLI installer, and treat the report as a limited assessment.

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/collect_assets.sh
Finding

Root inventory collector executes lower-privileged users' listening-process binaries

Content
View full analysis

Impact

An attacker-controlled listener can execute arbitrary code as root when audited, enabling access to protected files, system modification, or persistence. The two-second timeout and exception handling do not prevent immediate privileged side effects.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (16)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The all-project role-assignment operation changes account authorization beyond the individual ECS target. This is the same underlying excessive-delegation issue as the other TP4 finding, rather than an additional independent vulnerability; the legitimate audit purpose does not justify unrestricted project coverage.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The workflow creates a permanent service-trust agency and grants roles across all projects, leaving authorization changes in place after the audit. Although IAM setup is disclosed in the workflow and may be needed for COC, its persistent, account-wide scope unnecessarily increases the blast radius of misuse or compromise of the delegated service execution path.

Content

No source excerpt is available for this finding.

The workflow establishes persistent, account-wide IAM delegation without warning about its security impact.

High
Category
Output Handling
Confidence
95% confidence
Finding

A routine audit can establish permanent, all-project service delegation without a separate approval checkpoint or a clear explanation that cleanup does not revoke those permissions. Calling this one-time setup discloses the operation but does not adequately distinguish its lasting security consequences from temporary inventory collection.

Content

No source excerpt is available for this finding.

The audit workflow grants persistent, all-project agency permissions, including DCS access unrelated to ECS vulnerability inventory.

High
Category
Excessive Agency
Confidence
97% confidence
Finding

The prescribed role set includes DCS UserAccess even though the stated inventory target is ECS hosts and their workloads, and the workflow binds every role across all projects. No task-specific justification is provided for DCS access, so this broadens the agency's authority beyond the demonstrated need and compounds the persistent-delegation risk.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **Create Collector Script**: Register `scripts/collect_assets.sh` as a temporary COC shell script via `COC CreateScript`.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/collect_assets.sh (reported line 254)May include surrounding context.

sh
php_out = subprocess.check_output(["php", "-v"], stderr=subprocess.DEVNULL, timeout=3).decode("utf-8", "ignore")
    m = re.search(r'PHP[ ]+([0-9]+[.][0-9]+[.][0-9]+)', php_out)
    if m:
        lang_pkgs["php"].append({"name": "php", "version": m.group(1)})
except Exception:
    pass

inventory["language_packages"] = lang_pkgs

# 4. Containers
containers_info = {"runtimes": "", "running_containers": [], "images": []}
runtimes = []
for rt in ["docker", "podman", "nerdctl", "crictl"]:
    try:
        subprocess.check_call(["command", "-v", rt], shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
        runtimes.append(rt)
    except Exception:
        pass
containers_info["runtimes"] = ",".join(runtimes)

if "docker" in runtimes:
    try:
        docker_fmt = "{{.ID}}" + chr(9) + "{{.Image}}" + chr(9) + "{{.Names}}" + chr(9) + "{{.Status}}" + chr(9) + "{{.Ports}}"
        dps = subprocess.check_output(["docker", "ps", "--format", docker_fmt], stderr=subprocess.DEVNULL, timeout=5).decode("

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

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

md
5. **Vulnerability & KEV Matching** — Cross-reference identified assets against `https://db.gcve.eu/api/` (`/vulnerability/?product={product}` for product CVEs, `/kev` for confirmed in-the-wild exploitation, and `/epss` for exploit prediction scoring).
6. **Automatic Version Range Matching & CVSS Fallback** — Automatically evaluate whether the installed version falls within the CVE's affected version range (e.g. `8.3.* to <8.3.36`), extract CVSS scores with graceful fallback policies, and extract official vulnerability disclosure dates.
7. **Remediation Report Generation** — Output prioritized remediation guidance (P0 KEV criticals, package upgrade commands, container base image updates, network security group rules).
8. **Security Cleanup** — Automatically remove temporary COC scripts and remote scan artifacts.

**Tool chain:** Huawei Cloud KooCLI (`hcloud`) + Python 3 + `https://db.gcve.eu/api/`.

The skill sends discovered software identifiers to a public third-party API without a privacy warning.

Medium
Category
Output Handling
Confidence
88% confidence
Finding

The workflow audits all discovered components by default and places their product names in requests to db.gcve.eu. Although the API calls are documented, there is no warning that this discloses information about the target's software inventory to an external service.

Content

No source excerpt is available for this finding.

Requires all documentation to be written in English without user opt-in.

Medium
Category
Output Handling
Confidence
99% confidence
Finding

This acceptance criterion explicitly mandates English for all documentation, allowing only Chinese trigger keywords as an exception. It provides neither a user language choice nor a documented justification for the language restriction.

Content

No source excerpt is available for this finding.

Installation instructions execute downloaded shell scripts with automatic confirmation but provide no warning about system changes.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The Linux and macOS instructions execute a downloaded, mutable 'latest' installer without verifying its signature or integrity, while automatic confirmation reduces the opportunity to review installation changes. HTTPS and the apparent Huawei-hosted source reduce interception concerns, but a compromised distribution source could still execute arbitrary code with the invoking user's permissions; subsequent cloud credential configuration increases the potential consequences.

Content

No source excerpt is available for this finding.

Account-wide IAM role grants lack a warning about persistent cross-service access.

Medium
Category
Output Handling
Confidence
93% confidence
Finding

The setup directs users to bind every listed role to a COC service agency across all projects, with the agency configured to last forever, without warning about persistent access or requiring explicit approval of that scope. This can extend remote-execution capabilities and other service permissions beyond the intended audit targets, increasing the blast radius if an attacker gains the ability to abuse COC execution. A vulnerability auditor legitimately needs some remote access, but that purpose does not establish a need for permanent, account-wide grants or the listed DCS permissions.

Content

No source excerpt is available for this finding.

The documented all-components audit silently excludes most OS packages.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Without a product filter, the script silently restricts OS package checks to a hard-coded name allowlist despite advertising an audit of all discovered components. In a vulnerability-auditing tool, this coverage gap can leave vulnerable packages unexamined while producing a report that users may mistake for a comprehensive assessment; it does not directly compromise the host.

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/query_gcve.py (reported line 579)May include surrounding context.

python
lines.append("### 1. Host OS Packages")
    os_name = sys_info.get("os_name", "").lower()
    if "ubuntu" in os_name or "debian" in os_name:
        lines.append("```bash\nsudo apt-get update\nsudo apt-get --only-upgrade install <package_name>\n```")
    else:
        lines.append("```bash\nsudo yum update-minimal --security -y\n```")

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/query_gcve.py (reported line 579)May include surrounding context.

python
lines.append("### 1. Host OS Packages")
    os_name = sys_info.get("os_name", "").lower()
    if "ubuntu" in os_name or "debian" in os_name:
        lines.append("```bash\nsudo apt-get update\nsudo apt-get --only-upgrade install <package_name>\n```")
    else:
        lines.append("```bash\nsudo yum update-minimal --security -y\n```")

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/query_gcve.py (reported line 581)May include surrounding context.

python
if "ubuntu" in os_name or "debian" in os_name:
        lines.append("```bash\nsudo apt-get update\nsudo apt-get --only-upgrade install <package_name>\n```")
    else:
        lines.append("```bash\nsudo yum update-minimal --security -y\n```")

    lines.append("")
    lines.append("### 2. Network & Application Services")

Static analysis

No suspicious patterns detected.