Back to skill

Security audit

huawei-cloud-rds-export-markdown

Security checks for vulnerabilities and agentic risk

Overview

This RDS inventory exporter needs review because it requires an unaudited telemetry wrapper and weakens security checks when installing dependencies.

Before installing, request certificate-verified dependency downloads and an optional, audited telemetry integration with documented data collection. SKILL_QUALITY_REPORT=0 is a documented reporting opt-out, but does not remove the wrapper requirement or installation. Use cloud credentials limited to RDS listing and protect the report's instance IDs and private IPs. The downloaded wrapper was unavailable for inspection, so its reporting behavior remains uncertain; exfiltration or intentional malicious behavior is not established.

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

Arbitrary code execution with the invoking process's privileges, potentially exposing locally accessible cloud credentials and modifying files. This does not require compromising either legitimate mirror.

Vulnerability Patterns
  • 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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (16)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The added dependency installs persistent executables and supporting modules rather than merely producing an inventory report. Later documentation acknowledges the dependency, but does not make the unrelated installation an explicit, separately authorized action before the agent follows the workflow.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The headline capability describes RDS retrieval and local export, but the instructions also introduce automatic installation and mandatory execution of an unrelated telemetry wrapper. Although disclosed later in the document, this expands the trust boundary to downloaded executable code running with the user's cloud-access environment.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Installing and upgrading skill-quality-cli is not a supporting implementation detail of the declared RDS inventory workflow: the description identifies hcloud and huaweicloudsdkrds as its execution tools, not skill-quality-cli. The supplied chunk therefore introduces unrelated software-management behavior. The installer scripts themselves are not supplied, so their internal actions and any network or filesystem effects cannot be verified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The underlying RDS ListInstances command is consistent with the declared read-only query operation. However, the supplied code only invokes that query through a wrapper and does not implement the other central purpose: generating a local Markdown inventory. The wrapper's internal behavior is not supplied, so it cannot be assumed to provide export, fallback, or safety features. No cloud mutation or unrelated resource access is visible.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

The matched request fetches JSON rather than directly executing a script, but that JSON controls the executable archive subsequently installed and its expected checksum. A compromised release service can replace both values, and there is no pinned release, independent signature verification, or restriction on the manifest-selected download URL.

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.

The skill mandates a telemetry-enabled wrapper beyond the manifest's RDS-query and local-export workflow.

Medium
Category
Excessive Agency
Confidence
94% confidence
Finding

The mandatory-wrapper instruction redirects authorized cloud commands through a telemetry-capable component unrelated to producing the local report. That component can access command arguments, inherited credentials, and subprocess output; the provided sources do not establish what it reports, so actual exfiltration is not proven.

Content

No source excerpt is available for this finding.

The required report format fixes Chinese-language headers and empty-result text without offering a language choice.

Medium
Category
Output Handling
Confidence
94% confidence
Finding

The Markdown output specification prescribes Chinese column headers and a Chinese empty-result message regardless of the user's language. No language opt-in or justification for this output-language constraint is provided; selecting a Huawei Cloud region does not itself justify requiring Chinese report text.

Content

No source excerpt is available for this finding.

The guide introduces an unrelated quality-telemetry CLI and requires it to wrap every hcloud call.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The guide requires a telemetry-capable third-party executable to mediate every hcloud call despite that executable not being necessary for inventory export. Its visibility into inherited credentials and command results expands the trust boundary, while the guide does not specify the reported data or destination.

Content

No source excerpt is available for this finding.

Automatically installs an unrelated quality CLI outside the RDS inventory export workflow.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

When invoked without an existing working CLI, this helper downloads a mutable latest release and persistently installs unrelated executable software without a separate confirmation. SHA256 checking and archive-path checks are useful, but the checksum and executable location are both supplied by the same remote manifest, so compromise of that release authority can supply an attacker-controlled executable.

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 skill includes an installer for an unrelated quality CLI, beyond its RDS inventory export purpose.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

L26–L48 fetch a skill-quality-cli release manifest and binary archive, and L78–L88 install executable files and supporting modules persistently under ~/.local/bin. The declared skill requires KooCLI or the RDS SDK and local Markdown generation, not installation of a separate quality tool. Although the script documents manual invocation, that does not establish a purpose-related justification for this additional capability.

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

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_rds_export_markdown.py (reported line 271)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 265, 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/list_rds_export_markdown.py (reported line 271)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,
        )