Back to skill

Security audit

huawei-cloud-business-tf-support

Security checks for vulnerabilities and agentic risk

Overview

This skill is read-only in cloud intent, but it asks for Huawei Cloud credentials while bundling broader resource-query behavior and unsafe setup/network practices that users should review before installing.

Install only if you are comfortable giving the skill Huawei Cloud credentials and allowing local dependency setup. Review and fix the TLS-disabled API configuration and remote get-pip bootstrap path first, and use tightly scoped, read-only Huawei Cloud credentials limited to the billing/pricing and resource-query APIs you actually need.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/ensure_env.py:278
Finding

Remote Python Bootstrap Is Downloaded and Executed Without TLS or Integrity Verification

Content
View full analysis

Vulnerability Details

File Location: scripts/ensure_env.py:278-298
Vulnerability Type: Unverified remote code retrieval and execution
Risk Level: High

Vulnerable Code

python
get_pip_path = os.path.join(tempfile.gettempdir(), "get-pip.py")
urls = [
    "https://mirrors.huaweicloud.com/repository/pypi/simple/get-pip.py",
    "https://bootstrap.pypa.io/get-pip.py",
]

ctx = ssl._create_unverified_context()

for url in urls:
    info(f"尝试下载 get-pip.py: {url}")
    try:
        urllib.request.urlretrieve(url, get_pip_path, context=ctx)
    except Exception as e:
        print(f"    下载失败: {e}")
        continue

    rc, out, err = run_cmd([sys.executable, get_pip_path], timeout=120)
    if rc == 0:
        ok("get-pip.py 安装 pip 成功")
        return True

The module also globally changes the default HTTPS behavior:

python
ssl._create_default_https_context = ssl._create_unverified_context

Technical Analysis

The Skill instructions require the environment-check wrapper to run before performing queries (SKILL.md:73-80 and SKILL.md:104-107). That wrapper invokes ensure_env.py.

If pip is unavailable and the local ensurepip attempt fails, _ensure_pip() downloads get-pip.py from an external URL. The download explicitly uses an SSL context that does not validate the remote server's certificate. The resulting file is then executed immediately using sys.executable, without checking a cryptographic hash or signature.

Consequently, possession of any certificate is sufficient to impersonate the intended download server. This converts attacker-controlled network content directly into local Python code execution. The predictable temporary filename adds local hardening concerns, but the confirmed network-to-execution path exists independently of a local race.

Attack Path

  1. The user invokes the Skill, whose documented workflow requires running scripts/check_env.sh or scripts/check_env.ps1.
  2. The wrapper launches ...[truncated 1259 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove both uses of unverified SSL contexts:
    • Delete the assignment to ssl._create_default_https_context.
    • Do not pass _create_unverified_context() to urlretrieve.
  2. Use the operating system's trusted CA store and fail closed on certificate-validation errors.
  3. Prefer a locally provided ensurepip installation path instead of downloading and executing a bootstrap script.
  4. If a remote bootstrap is unavoidable:
    • Pin an expected SHA-256 or stronger digest.
    • Download to a securely created file using tempfile.NamedTemporaryFile.
    • Verify the digest or a trusted digital signature before execution.
    • Delete the temporary file in a finally block.
  5. Do not automatically fall back to another executable source after a verification failure.
  6. Present a clear error requiring manual remediation if the verified installation process cannot continue.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py:8
Finding

TLS Certificate Verification Is Disabled for Authenticated Huawei Cloud API Requests

Content
View full analysis

Vulnerability Details

File Location: scripts/config.py:8-64
Vulnerability Type: Insecure authenticated transport configuration
Risk Level: Medium

Vulnerable Code

python
# 抑制因 ignore_ssl_verification 产生的 InsecureRequestWarning
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
python
def build_http_config():
    """构建 HTTP 配置,代理支持环境变量

    代理 URL 来源(优先级从高到低):
      1. HTTPS_PROXY
      2. HTTP_PROXY

    代理 URL 格式:
      - http://host:port
      - http://user:pass@host:port
    """
    http_config = HttpConfig.get_default_config()
    http_config.ignore_ssl_verification = True
    http_config.timeout = (30, 60)
    http_config.retry_times = 3

    proxy_url = _get_proxy_url()
    if proxy_url:
        parsed = urlparse(proxy_url)
        http_config.proxy_protocol = parsed.scheme or "http"
        http_config.proxy_host = parsed.hostname or ""
        http_config.proxy_port = parsed.port or 8080
        http_config.proxy_user = parsed.username or ""
        http_config.proxy_password = parsed.password or ""

    return http_config

A representative reachable use appears in scripts/bss/show_customer_account_balances.py:24-31:

python
http_config = build_http_config()
client = BssClient.new_builder().with_http_config(http_config).with_credentials(
    GlobalCredentials(AK, SK) if not SecurityToken else GlobalCredentials(AK, SK).with_security_token(SecurityToken)).with_region(BssRegion.CN_NORTH_1).build()
if not client:
    print("无法获取 Bss 客户端")
    exit(-1)

request = ShowCustomerAccountBalancesRequest()
response = client.show_customer_account_balances(request)

Technical Analysis

build_http_config() explicitly sets ignore_ssl_verification to True. It also suppresses the warning that would otherwise disclose the insecure connection. Query scripts import this shared function and attach the resulting configuration to authenticated Huawei Cloud SDK clients.

The examined API calls are read op ...[truncated 2161 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove http_config.ignore_ssl_verification = True or explicitly set it to False.
  2. Remove suppression of InsecureRequestWarning so accidental insecure configurations remain visible.
  3. Use the operating system's trusted CA store for all Huawei Cloud SDK connections.
  4. If an enterprise TLS-inspection proxy is required, support a narrowly scoped custom CA bundle rather than disabling verification globally.
  5. Validate proxy configuration and require an authenticated, trusted proxy where applicable.
  6. Fail closed when endpoint certificate or hostname validation fails.
  7. Add automated tests asserting that production API clients never enable ignore_ssl_verification.
  8. Rotate temporary credentials if they were used over an untrusted network while this configuration was active.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (115)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

SFS Turbo share type discovery is outside the promised billing/pricing domain and reveals storage capabilities and platform metadata unrelated to user expectation. The main risk is unauthorized or unexpected cloud reconnaissance facilitated by misleading packaging.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest says the skill is only for billing/pricing inquiries, but the body documents a general Huawei Cloud resource inventory/query tool. This inconsistency materially affects risk because reviewers and agent policy may permit a narrowly scoped finance helper while the skill can enumerate broader cloud resources.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The execution flow explicitly directs the agent to run arbitrary service/resource query scripts, not billing-only scripts. This operational guidance broadens the skill from a finance helper into a general script launcher for cloud queries, which is more dangerous in the presence of credentials and local execution.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says this skill is limited to billing and pricing inquiries, but the script exposes bare metal flavor enumeration via BMS APIs. This is a scope-expansion flaw: an agent or user relying on the manifest could be induced to access infrastructure metadata outside the declared business purpose, weakening least-privilege and trust boundaries even though the operation is read-only.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code directly constructs a BMS client and calls list_baremetal_flavor_detail_extends, which is unrelated to billing, balances, refunds, orders, or pricing data described by the skill metadata. In an agent setting, this mismatch can cause unauthorized capability exposure and unintended data access because the implementation does more than the declared scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This script invokes a geographic county-listing API and formats administrative region data, which is outside the skill's declared billing/pricing-only scope. In an agentic environment, scope drift is dangerous because the agent may call unintended cloud APIs, violating least privilege, confusing routing logic, and enabling unauthorized data access beyond the user's expected billing inquiry.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · scripts/check_env.ps1 (reported line 1)May include surrounding context.

text
<#
华为云资源查询 - 环境检查前置脚本 (Windows PowerShell)
#>

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This script queries ECS flavor inventory and exposes infrastructure enumeration functionality that is outside the manifest’s stated billing/pricing-only scope. In an agent setting, capability drift is dangerous because callers may gain access to cloud resource discovery primitives they were not meant to have, undermining least-privilege assumptions and enabling reconnaissance for later abuse.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This script performs ELB infrastructure/flavor enumeration, which is outside the declared billing-only scope of the skill. Even though it is read-only, it expands the agent’s reachable capability into service inventory and pricing-adjacent infrastructure discovery, enabling unintended cloud reconnaissance and violating least privilege and user expectations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script performs broad Huawei Cloud environment setup and validates credentials through IAM and ECS-oriented checks even though the skill is declared as billing/pricing-only. This scope expansion is dangerous because it normalizes use of more privileged cloud APIs than necessary and can expose account metadata unrelated to the stated billing function.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

For a read-only billing inquiry skill, creating virtual environments and re-executing into a new interpreter adds unnecessary execution and environment mutation capability. In a skill context, this is more dangerous because it expands behavior from simple cloud queries into local system modification and execution chaining without being justified by the manifest.

Content

No source excerpt is available for this finding.

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

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

python
# 用 venv Python 重新执行当前脚本
    print(f"  使用虚拟环境 Python: {venv_python}")
    os.execv(venv_python, [venv_python] + sys.argv)

def info(msg):
    print(f"  {msg}")