Back to skill

Security audit

huawei-cloud-sfs-export-markdown

Security checks for vulnerabilities and agentic risk

Overview

This inventory exporter needs review because its instructions require additional telemetry software around cloud commands and its dependency installer weakens download security.

Before installing, require telemetry to be optional and review its exact implementation, collected fields, and destinations. Disabling reports alone does not verify the wrapper's behavior. Install SDK dependencies with certificate verification enabled, use read-only cloud credentials, and keep command overrides unset unless trusted. The bundled installers and exporter were reviewed; remotely downloaded telemetry code remains outside the inspected package, so its data handling is unresolved.

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

A network attacker can execute arbitrary code under the user's account by substituting a package during dependency preparation.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 (17)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Persistent executable installation under ~/.local/bin exceeds the prominent description of read-only cloud access and local Markdown generation. The dependency is mentioned later, so it is not wholly concealed, but requiring unrelated downloaded code exposes subsequent credential-bearing commands to an additional supplier and update channel.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The advertised inventory-and-local-export scope expands into installing executable telemetry tooling and requiring it around cloud commands. Although the body documents this dependency, the automatic installation creates an additional software trust boundary in a credential-bearing environment; the supplied installer code supports this concern, but does not establish malicious behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared workflow uses hcloud or huaweicloudsdksfsturbo to query SFS and generate a local Markdown file. The supplied commands instead manage skill-quality-cli, which has no stated role in that workflow. This is an undeclared tool-installation and upgrade capability, not an evident supporting implementation detail. The snippet provides no evidence of cloud writes or other behavior inside the referenced scripts.

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

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

A quality-telemetry dependency is progressively made mandatory for cloud commands, including credential inspection.

Medium
Category
Prompt Injection
Confidence
93% confidence
Finding

The instructions turn a quality-reporting dependency into a mandatory intermediary for authenticated cloud commands, including credential inspection. Disabling reports does not necessarily remove the wrapper's execution or access to sensitive process context, and no wrapper implementation is supplied to verify its behavior.

Content

No source excerpt is available for this finding.

The skill mandates unrelated telemetry tooling for SFS queries and credential checks.

Medium
Category
Excessive Agency
Confidence
95% confidence
Finding

The mandatory wrapper places unrelated telemetry software in the execution path of both inventory queries and credential-profile inspection. That software can potentially access inherited credentials and child-process output; its implementation is absent, so actual collection or exfiltration cannot be established.

Content

No source excerpt is available for this finding.

L73–L88 introduce an unrelated quality-telemetry tool and require wrapping every hcloud invocation with it.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

This guide requires every hcloud invocation to pass through an unrelated telemetry executable rather than limiting it to optional reporting. The wrapper consequently occupies a sensitive trust position with potential access to inherited cloud credentials and inventory output, although the guide does not prove that it transmits either.

Content

No source excerpt is available for this finding.

The script automatically downloads and persistently installs an unrelated skill-quality-cli tool, outside the SFS inventory export purpose.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

When invoked without a working existing CLI, this helper downloads a manifest-selected package and installs executable files persistently without a separate confirmation. SHA256 verification and archive path checks reduce some risks, but the manifest controls both the artifact and its checksum, so compromise of that release channel could introduce code later used around authenticated cloud commands.

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; }

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/ensure_env.py (reported line 55)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,
        )

The script downloads and installs an unrelated skill-quality CLI outside the SFS inventory export workflow.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

This manually invoked installer adds unrelated executable software that the surrounding skill requires for cloud commands, broadening the trust boundary beyond inventory export. Manual invocation reduces surprise, but the unpinned latest manifest selects both the executable archive and its checksum, leaving release-channel compromise capable of supplying code for later credential-bearing execution.

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/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

Environment command overrides bypass the manifest's ListShares-only execution guard.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

The write-intent guard checks the script's command-line arguments and operation value, but not the environment overrides used to construct the actual process invocation. Consequently, the claimed ListShares-only boundary does not constrain the executed program, potentially permitting local code execution or cloud mutations when environment configuration is attacker-controlled; this overlaps with TT2 rather than representing an independent execution flaw.

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_sfs_export_markdown.py (reported line 305)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 299, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
90% confidence
Finding

SFS_EXPORT_MD_HCLOUD_BIN selects an arbitrary executable, while SFS_EXPORT_MD_HCLOUD_ARGS supplies arguments before the fixed ListShares arguments. If an attacker can influence these environment variables, an interpreter or another program can execute attacker-selected code with the agent's privileges and access to cloud credentials; shell=False does not prevent this, although no untrusted environment-setting path is demonstrated here.

Content

Scanner excerpt · scripts/list_sfs_export_markdown.py (reported line 305)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,
        )

The output format mandates Chinese labels and messages without offering a language choice.

Low
Category
Output Handling
Confidence
91% confidence
Finding

The skill requires Chinese metadata text, table headers, and empty-result messages in generated reports regardless of the user's language. It provides neither a language opt-in nor a documented reason that the report must use Chinese; the cloud region selection does not justify a fixed report language.

Content

No source excerpt is available for this finding.