Back to skill

Security audit

huawei-cloud-product-list

Security checks for vulnerabilities and agentic risk

Overview

This catalog tool needs review because its setup weakens download security and environment settings can bypass its advertised read-only guard.

Prefer a corrected version that preserves certificate verification and removes arbitrary executable overrides. Install reviewed, pinned dependencies in an isolated environment, use narrowly scoped read-only credentials, and invoke it explicitly for Huawei Cloud. All bundled files were inspected and command construction was checked with mocked subprocesses; external installers, downloaded packages, and live cloud behavior were not verified.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Error
Location
scripts/ensure_env.py
Finding

Dependency installation disables TLS certificate verification for package mirrors

Content
View full analysis

Impact

An active network attacker can substitute an SDK distribution and execute arbitrary Python code. Successful mirror installation returns immediately, so the official-index fallback does not prevent substitution. This is a coding vulnerability, not evidence that the mirrors or packages are malicious.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (7)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_list_products.py (reported line 357)May include surrounding context.

python
self.addCleanup(self._builder_patch.stop)

    def _clean_credential_env(self):
        env = dict(os.environ)
        for key in _CREDENTIAL_ENV_KEYS:
            env.pop(key, None)
        return env

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, 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.

Generic catalog trigger phrases can activate the Huawei Cloud skill for unrelated catalog requests.

Medium
Category
Trigger Abuse
Confidence
91% confidence
Finding

The trigger list includes unqualified phrases such as "service catalog", "product catalog", "产品目录", and "list cloud services" that can refer to other providers or non-cloud catalogs. Although the skill's purpose is Huawei-specific, these triggers do not require Huawei Cloud context, and the write-operation exclusions do not resolve that ambiguity.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
96% confidence
Finding

The subprocess call uses an argument list and does not introduce shell injection, but its caller installs executable Python packages from mirrors using --trusted-host, disabling certificate verification for those hosts. A network attacker able to intercept mirror traffic could substitute packages that execute during installation or subsequent imports; unpinned dependencies without verified hashes compound this supply-chain risk.

Content

Scanner excerpt · scripts/ensure_env.py (reported line 56)May include surrounding context.

python
def run_cmd(cmd, timeout=300):
    try:
        proc = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            timeout=timeout, universal_newlines=True,
        )

Environment-controlled executable and arguments bypass the advertised read-only execution guard.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

The read-only guard checks user command-line arguments and the requested operation, but it does not check the environment-controlled program or prefix arguments actually executed. Consequently, an attacker-controlled environment can bypass the advertised read-only restriction entirely, although ordinary catalog filter inputs alone do not provide this control.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/list_products.py (reported line 232)May include surrounding context.

python
cmd.extend(extra)
    cmd.extend(argv)
    try:
        proc = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            timeout=120, universal_newlines=True,
        )

Tainted flow: 'cmd' from os.environ.get (line 226, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
95% confidence
Finding

PRODUCT_LIST_HCLOUD_BIN selects the executable, and PRODUCT_LIST_HCLOUD_ARGS supplies unchecked arguments before the fixed BSS operation. If an attacker can influence the inherited environment, they can replace the CLI with another program and supply its options, executing code with the agent's privileges and access to inherited cloud credentials; no shell is required.

Content

Scanner excerpt · scripts/list_products.py (reported line 232)May include surrounding context.

python
cmd.extend(extra)
    cmd.extend(argv)
    try:
        proc = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            timeout=120, universal_newlines=True,
        )