Back to skill

Security audit

huawei-cloud-ces-alarm-rules-list

Security checks for vulnerabilities and agentic risk

Overview

The cloud queries are read-only, but default telemetry lacks clear data limits and dependency installation weakens download security.

Use credentials limited to CES read access. Set SKILL_QUALITY_REPORT=0 and skip reporting-tool installation until its data collection and destination are understood. Install SDK dependencies from a certificate-verified source in an isolated environment instead of using the bundled installer. The downloaded reporting tool was unavailable for inspection, so its handling of cloud output and credentials remains uncertain.

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 setup, potentially exposing files and cloud credentials accessible to that user.

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
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
Findings (16)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The workflow introduces automatic installation of an unrelated executable that subsequently mediates authenticated cloud commands, expanding trust beyond the advertised read-only CES operations. The body does disclose this dependency, so it is not entirely undeclared; nevertheless, a compromised dependency could execute with the user's privileges and credential access, and the installer implementation is unavailable here for verification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This identifies the same trust-expanding installation behavior as the other TP4 finding: an unrelated downloaded tool becomes a persistent executable used around cloud queries. Documentation discloses installation, but the read-only cloud-operation guard does not constrain that executable's local or network behavior; the supplied source does not establish whether the installer verifies artifacts or prevents overwrites.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/ces_alarm_rules.py (reported line 1260)May include surrounding context.

python
{"alarm_id": rule_id, "limit": MAX_PAGE_SIZE}, 0)
        _, resources = _query_page(OPERATION_RESOURCES, region,
                                   {"alarm_id": rule_id, "limit": MAX_PAGE_SIZE}, 0)
        return rule, policies, resources, payload
    return None, policies, resources, payload

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, network, 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 introduces an unrelated telemetry CLI that wraps every hcloud invocation, although the manifest only describes CES alarm inventory and detail queries.

Medium
Category
Excessive Agency
Confidence
93% confidence
Finding

The guide directs installation of an unrelated reporting executable and places it around every authenticated hcloud invocation, giving it an opportunity to access command output and inherited credentials. This is documented rather than hidden, but the guide supplies no reporting-data boundaries or affirmative opt-in; actual sensitive-data transmission is not demonstrated by this source.

Content

No source excerpt is available for this finding.

CES queries are automatically routed through an undeclared telemetry/quality-reporting executable.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

Reporting defaults to enabled, and an available quality executable becomes the parent of every hcloud query without environment isolation or output restrictions. It can consequently observe sensitive inventory output and inherit credential-bearing environment variables; documentation acknowledges the wrapper, but this code does not establish what it transmits or enforce the advertised read-only boundary on it.

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/ces_alarm_rules.py (reported line 424)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 422, 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/ces_alarm_rules.py (reported line 424)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 skill automatically downloads and installs an unrelated quality-management CLI outside its CES inventory purpose.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

When invoked, this helper automatically installs a remotely supplied executable unrelated to CES inventory into the user's executable directory, without a separate approval step. HTTPS, mandatory SHA256 verification, and archive checks reduce tampering risks, but do not justify this additional dependency or protect against a compromised publisher supplying both the package and its checksum.

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

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

The skill installs an unrelated skill-quality-cli executable, a capability outside CES alarm-rule inventory.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

This installer adds an unrelated, remotely supplied quality-management executable to the user's environment, expanding the supply-chain exposure of a CES inventory skill. Manual invocation reduces the risk of unexpected installation, but the dependency remains unnecessary for the stated functionality, and its checksum comes from the same publisher-controlled manifest as the package URL.

Content

No source excerpt is available for this finding.

The acceptance criteria require Chinese-language severity and status labels without offering a language choice or documenting a locale-specific justification.

Low
Category
Output Handling
Confidence
90% confidence
Finding

The checklist explicitly specifies Chinese mappings for alarm severity and status, including the label “数据不足.” This mandates a particular language for those output fields without user opt-in or an explained locale requirement.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/ces_alarm_rules.py (reported line 645)May include surrounding context.

python
OPERATION_STATE: "list_alarms",
    }[operation]
    request = loader["requests"][operation](**params)
    response = _sdk_call(getattr(client, method), request)
    payload = _jsonable(response.to_dict())
    return payload, extract_items(payload, operation)