Back to skill

Security audit

huawei-cloud-cdn-export-domains

Security checks for vulnerabilities and agentic risk

Overview

This CDN exporter needs review because its setup weakens download security, its telemetry is insufficiently explained, and its bundled live test runner exceeds its read-only scope.

Use a dedicated CDN read-only identity. Install SDK dependencies separately with certificate verification enabled, preferably in an isolated environment. Set SKILL_QUALITY_REPORT=0 and skip quality-tool installation until its executable and reporting behavior are reviewed. Use the documented offline tests instead of the generic live runner, and check exported domains before sharing because SDK fallback ignores exact-match. All bundled files were inspected; the separately downloaded reporting executable remains unverified.

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

Content
View full analysis

Impact

Arbitrary code execution during package installation or the immediate import, with access to files and credentials available to that process.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Rogue AgentSelf-Modification, Session Persistence
Findings (25)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied script's primary purpose is validating a skill against a structural and security specification, which is materially different from the declared CDN-listing workflow. It does not execute hcloud CDN ListDomains, invoke the CDN SDK, process CDN pagination or filters, or generate domain-list exports. Its checks of hcloud command text and write-operation confirmation are static documentation checks, not the declared runtime write-intent guard. This assessment is limited to the supplied code chunk; it does not establish whether other files implement the declared functionality. No cloud mutation or network exfiltration is evident in this script.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Installing or overwriting quality-tool executables introduces local software modification and subsequent code execution beyond read-only CDN access. Although the body mentions installation, the automatic latest-release dependency unnecessarily exposes a credentialed workflow to release-service or package compromise.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The bundled generic functional runner provides a separate path for configuration-supplied hcloud and curl commands without the exporter’s ListDomains-only restriction. If invoked on malicious or mistaken test configuration, it can perform live cloud mutations or unrelated requests with ambient privileges; this does not establish that the normal exporter itself permits mutations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill adds an unnecessary executable-installation trust boundary to a CDN inventory workflow: its readiness helper downloads a manifest-selected release and installs persistent executable files. The documentation does disclose this dependency, so it is not wholly hidden, but an automatically selected release can subsequently execute with access to the user's cloud credentials and query results.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Default wrapping places an additional reporting-capable program around credentialed cloud commands, potentially exposing command metadata or results beyond the CDN service and local export boundary. Telemetry is disclosed in the body and can be disabled, and no particular leaked payload is established; the alleged SDK filter omissions are functional defects rather than independently demonstrated security vulnerabilities.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The automatic installation component introduces unnecessary executable supply-chain exposure into an authenticated inventory workflow. Manual upgrade instructions and a telemetry-disable setting are not vulnerabilities by themselves, and the documentation explicitly says upgrades are not automatic.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The supplied chunk contains no Huawei Cloud API or CLI calls, domain processing, export generation, or write-intent guard. Its standalone metadata-validation purpose is materially different from the declared CDN functionality, rather than an implementation detail of that functionality. This assessment applies only to the supplied chunk; other files could implement the declared features. No network access, cloud mutation, or malicious behavior is evident.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/install_cli.sh (reported line 28)May include surrounding context.

sh
API_URL="https://skillsapi.developer.myhuaweicloud.com/api/quality/cli/latest"

manifest="$(curl -fsSL --connect-timeout 5 --max-time 20 "${API_URL}")"
v="$(printf '%s' "$manifest" | python3 -c 'import sys,json;print(json.load(sys.stdin)["version"])')"
case "$(uname -s)" in
    Linux) ;;

The test runner executes configured cloud operations without enforcing the promised ListDomains-only, read-only guard.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The allowlist checks the executable name but permits arbitrary hcloud services, operations, and arguments from test-vars.json. Despite comments promising help-only mutation checks, the runner executes these commands directly, allowing malicious or mistaken test configuration to mutate cloud resources using the active profile.

Content

No source excerpt is available for this finding.

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_export_cdn_domains.py (reported line 457)May include surrounding context.

python
self.addCleanup(self._builder_patch.stop)

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

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

The guide specifies mandatory quality telemetry unrelated to CDN domain querying or local export.

Medium
Category
Excessive Agency
Confidence
95% confidence
Finding

The guide routes authenticated cloud commands through an unrelated reporting-capable executable by default, adding a potential recipient of sensitive command metadata and inventory output. An opt-out is provided and no actual telemetry payload is shown, so confirmed credential exfiltration cannot be inferred.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/ensure_cli.sh (reported line 89)May include surrounding context.

sh
echo "警告: 解压失败或 tar 包含不安全条目, 拒绝安装" >&2
        return 1
    fi
    mkdir -p ~/.local/bin/skill-quality-cli.d || { echo "警告: 创建安装目录失败" >&2; return 1; }
    [ -f "${tmp}/skill-quality-cli" ] || { echo "警告: 安装包内容缺失(skill-quality-cli)" >&2; return 1; }
    # 主二进制: 复制/可执行位失败必须显式失败(不再静默吞错)
    cp "${tmp}/skill-quality-cli" ~/.local/bin/skill-quality-cli || { echo "警告: 复制 skill-quality-cli 失败" >&2; return 1; }

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/install_cli.sh (reported line 78)May include surrounding context.

sh
echo "错误: 解压失败或 tar 包含不安全条目, 拒绝安装" >&2
        exit 1
    fi
mkdir -p ~/.local/bin/skill-quality-cli.d
cp "${tmp}/skill-quality-cli" ~/.local/bin/skill-quality-cli || { echo "错误: 复制 skill-quality-cli 失败" >&2; exit 1; }
chmod +x ~/.local/bin/skill-quality-cli || { echo "错误: 设置可执行位失败" >&2; exit 1; }
if [ -f "${tmp}/skill-quality-cli.bin" ]; then

The skill automatically downloads and installs an unrelated quality CLI outside its CDN-export purpose.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

A readiness check automatically installs executable code selected by a mutable remote manifest into the user's persistent executable directory. HTTPS, mandatory SHA256 comparison, and archive path checks provide useful protections, but a compromised manifest publisher can supply both a malicious archive and its matching hash; later execution inherits the user's privileges.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
97% confidence
Finding

The subprocess call uses an argument list without a shell, so the match does not demonstrate shell injection. However, its concrete pip callers pass --trusted-host for the mirrors, weakening TLS certificate verification while installing unpinned executable packages; a network attacker could substitute packages that later run with access to cloud credentials.

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,
        )

CDN queries are automatically routed through an undeclared telemetry-reporting tool.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

When available, skill-quality-cli automatically wraps cloud queries unless telemetry is explicitly disabled, although telemetry is absent from the supplied skill description. This gives an additional reporting component access to query arguments, inherited environment credentials, and potentially command results; the supplied code does not establish exactly what it transmits.

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

python
guard_write_intent(" ".join(extra))
    cmd = build_hcloud_command(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 432, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/export_cdn_domains.py (reported line 434)May include surrounding context.

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

The SDK fallback silently drops the requested exact-match and show-tags parameters.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The SDK fallback silently omits exact_match and show_tags despite accepting them on the CLI path. In particular, dropping an explicitly requested exact match can export additional authorized domains into a report intended for narrower sharing; this is a data-minimization failure, not an IAM bypass.

Content

No source excerpt is available for this finding.

The script downloads and persistently installs an unrelated skill-quality CLI outside the CDN export skill's stated purpose.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

L26-L48 fetch a quality-CLI release manifest and binary archive, while L78-L88 install executable files and supporting modules into ~/.local/bin. The manifest authorizes CDN queries through hcloud or the CDN SDK and local domain-list exports, not installation of skill-quality-cli; manual invocation and checksum validation do not make this unrelated capability part of the declared scope.

Content

No source excerpt is available for this finding.

The runner permits unrestricted curl requests unrelated to CDN domain listing.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

Allowing the curl executable without validating its arguments permits arbitrary destinations, methods, upload sources, configuration files, and output paths. Malicious test configuration can therefore upload readable local files, reach internal services, or perform state-changing requests even though shell metacharacters are blocked.

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

sh
# ak=..., sk=...) inside a BasicCredentials(...) call — both are
    # in-band secret-entry forms that put AK/SK on a command
    # line / SDK kwarg, contradicting the Pre-check contract:
    #   'NEVER ask the user to type or paste AK/SK in chat; user must
    #    set env vars in shell profile out-of-band and re-run.'
    # Whitelist: lines that contain the patterns inside NEVER / Do NOT
    # / 禁止 / forbidden contexts (prose warnings about the anti-pattern

Markdown exports require Chinese column labels and summary text without a language choice.

Low
Category
Output Handling
Confidence
90% confidence
Finding

The Markdown format explicitly fixes column labels and summary text in Chinese, regardless of the user's language. No language opt-in or justification for this locale constraint is documented; selecting an output format is not a language choice.

Content

No source excerpt is available for this finding.

The smoke-test expectations require Chinese output without offering a language choice or explaining the locale requirement.

Low
Category
Output Handling
Confidence
88% confidence
Finding

The verification criteria prescribe the Chinese column label 域名 and the Chinese empty-result message 当前区域(cn-north-1)无 CDN 加速域名. This makes Chinese output a requirement without documented user opt-in or a justification for that language constraint.

Content

No source excerpt is available for this finding.