Back to skill

Security audit

huaweicloud-skill

Security checks for vulnerabilities and agentic risk

Overview

This Huawei Cloud skill is mostly coherent, but its MaaS helpers can send API keys and prompts/images to a caller-supplied endpoint, which needs review before installation.

Review the MaaS scripts before enabling live model calls. Do not use --base-url unless you have verified it is the official Huawei Cloud MaaS host, and keep API keys in scoped environment variables. Treat hcloud submit/change flows, billing reads, Terraform state actions, and SDK installation commands as explicit-review actions, not automatic defaults.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/maas_common.py:38
Finding

Caller-Controlled MaaS Endpoint Can Exfiltrate API Keys and Request Payloads

Content
View full analysis
str: """Return a normalized MaaS endpoint URL.""" if path.startswith("http://") or path.startswith("https://"): return path return f"{base_url.rstrip('/')}/{path.lstrip('/')}" ``` ```python def build_headers(api_key: str) -> dict[str, str]: """Build MaaS JSON API headers.""" return { "Content-Type": "application/json", "Authorization": f"Bearer {api_key}", } def request_json( method: str, path: str, *, api_key: str, body: dict[str, Any] | None = None, timeout: int = 120, base_url: str = DEFAULT_MAAS_BASE_URL, ) -> dict[str, Any]: """Call a MaaS JSON API endpoint and return a structured response.""" url = endpoint_url(path, base_url) payload = None if body is None else json.dumps(body, ensure_ascii=False).encode("utf-8") request = urllib.request.Request(url, data=payload, headers=build_headers(api_key), method=method.upper()) ``` The chat caller obtains the real API key and passes the caller-controlled base URL to this transport: ```python api_key = maas_common.get_api_key() response = maas_common.request_json( "POST", endpoint_path(args), api_key=api_key, body=payload, timeout=args.timeout, base_url=args.base_url, ) ``` ```python parser.add_argument("--base-url", default=maas_common.DEFAULT_MAAS_BASE_URL) ``` Equivalent `--base-url` execution paths are also present in `scripts/maas_models.py`, `scripts/maas_image_generation.py`, and `scripts/maas_video_generation.py`. ### Technical Analysis The MaaS transport accepts an arbitrary caller-provided base URL and attaches the Huawei MaaS API key as an HTTP bearer credential with ...[truncated 1967 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
references/sdk-supplement.md:28
Finding

Unpinned Huawei Cloud SDK Installation Instructions Create Supply-Chain Risk

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (333)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

声明描述聚焦于华为云 CLI/MaaS 能力与云资源操作,而实际代码是一个本地 Shell 校验脚本,仅对 Terraform 示例进行格式检查、初始化(禁用 backend)和语法/配置验证。代码没有体现任何华为云 API、CLI、认证排查、资源分析或变更规划相关行为,主要目的与声明明显不符,因此属于实质性描述-行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

该代码块的核心功能非常明确:读取本地 metaRepo 中的 services_.json、apis_.json 及 detail 文件,提取服务/操作/参数信息,计算摘要和指纹,并将结果写入 references 目录下的 catalog/index/fingerprint JSON 文件。全程没有 subprocess、网络请求、hcloud CLI 调用、华为云 API 调用、认证流程处理或资源变更逻辑。因此其实际行为与声明的技能用途存在实质性偏差。虽然它与 hcloud 生态相关,但仅是“构建本地服务目录参考数据”的辅助生成脚本,远不足以支撑声明中描述的云资源操作与 MaaS 能力。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a cloud operations and MaaS API skill centered on interacting with Huawei Cloud resources and AI services. The actual code does none of that: it only loads a local JSON mapping, inspects file existence and modification times under the repository root, and reports whether curated reference documents may be outdated relative to source materials. This is a materially different primary purpose and resource scope (local files instead of cloud services/APIs), so the description does not accurately represent the code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向华为云运维与 MaaS 能力调用的通用技能,涵盖 CLI 资源操作、变更规划与多模态/大模型 API 调用。代码却只是 check_question_coverage.py,其核心行为是:读取本地 generated_questions JSON、service registry 和 XLSX 工作簿;校验问题条目结构、CRUD 类型、风险等级、注册覆盖率;从“验证方法”文本中提取 API 名称并检查是否在注册表中以及是否存在执行路径;最后输出 JSON 审计结果。整个代码块没有执行 hcloud 命令、没有网络请求、没有 MaaS API 调用、没有云资源查询/修改逻辑。虽然它引用了 hcloud_change_plan 和 hcloud_common,但用途仍是静态风险判断和本地数据校验,属于与声明主用途明显不同的工具。因此应判定为描述与实际行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

该代码块的核心功能是一个多子命令 CLI:plan/run/evaluate/chain,用于从生命周期计划构建 probe plan、可选执行受限的网络探测,并评估证据结果。这属于验收闭环/探测编排工具。声明描述则强调华为云 hcloud 命令行资源操作和 MaaS API 能力。两者在主要目的和实际能力上明显不一致。代码中虽使用了 hcloud_ 前缀模块名,但从可见逻辑看并未调用华为云 CLI、云资源 API 或 MaaS 服务;反而明确限制为内置 HTTP/TCP/DNS/TLS probes。因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

该代码块的核心用途是离线评估本地验收证据是否满足生命周期关闭计划:解析 plan/evidence JSON、标准化状态、按服务聚合结果并输出总结。虽然文件名和公共库名含有 hcloud,但没有看到任何 CLI 调用、网络请求、云资源访问、MaaS 接口调用或变更执行逻辑。声明描述的是一个面向华为云 CLI 与 MaaS 的通用资源操作/规划技能,而实际代码只是一个局部的本地验证工具,主目的和能力范围都明显更窄且不同,因此属于描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description presents a broad Huawei Cloud operations skill centered on executing hcloud/KooCLI resource operations and MaaS API calls. In contrast, this code chunk only parses a provided JSON plan and emits conservative, non-executing probe templates for acceptance evidence. Its explicit boundaries state planning_only and templates_only_no_live_probe. That is a materially different primary purpose from cloud CLI/API execution and validation, so this chunk does not accurately represent the declared skill behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是一个面向华为云 CLI 与 MaaS API 的综合操作技能,核心能力应包括云资源查询/变更、命令执行辅助、以及 MaaS 多模态任务调用。但给出的代码只实现了一个安全受限的探针运行器:解析参数和占位符,从 probe plan 中识别少量支持的模板(curl、tcp_connect、dig/nslookup、openssl s_client),执行有限的网络探测,并阻止私网、回环、metadata、link-local 等目标。其输出是 probe/evidence 状态,而不是云资源或 MaaS 任务结果。虽然这可被勉强归入“执行验证”的边缘场景,但与声明中的主要用途相比明显偏离,且遗漏了声明中最关键的大部分能力,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个广泛的华为云操作与 MaaS 调用技能,包含 CLI 资源操作、变更规划、认证排查以及多模态 API 调用。但提供的代码只做本地文件解析与差异报告生成:读取 reference-projects 下的 billing/bss 文档与脚本目录,结合 hcloud_billing_readonly 中的本地操作元数据,对官方和本地支持的 BSS List/Show 操作做覆盖比对,并输出缺口分类与后续建议。代码中还显式声明 execution_boundary 为 local_reference_diff_only_no_hcloud_no_credentials,说明其行为与描述中的实际云操作、凭证使用、MaaS 能力完全不一致。故应判定为明显的描述-行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

该描述与代码存在明显不一致。代码文件名和实现内容都表明其核心功能是“billing readonly planner”。它定义了大量 BSS 账单/成本/订单/优惠券/资源包/定价相关操作,生成 request_spec、分页/语义约束和 hcloud_command_plan,并且多处强调 planning_only、read_only、does not sign or send HTTP requests、execution_requires_user_approval。也就是说,它是一个计费查询与定价询价的只读命令规划器,而不是一个可泛化到‘华为云资源查询、分析、规划和变更’的综合技能。更重要的是,声明中提到的 MaaS API 多模态/生成式能力在代码中完全没有出现,属于明显的过度声明。虽然描述中的“命令构造”与“规划”部分和代码部分吻合,但主能力范围、是否执行、是否支持变更、以及是否支持 MaaS API 都存在实质偏差,因此应判定为 mismatch。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description presents a broad operational skill for interacting with Huawei Cloud via hcloud/KooCLI and MaaS APIs, including querying, planning, and changing resources as well as invoking AI services. The actual code only audits consistency between a generated catalog and a curated registry using local modules and files. Its outputs are drift reports and coverage summaries, not cloud actions or API calls. This is a materially different primary purpose, so the description does not accurately represent the code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description claims a broad operational skill for executing Huawei Cloud CLI actions and MaaS API tasks. However, this code only parses local files and selects metadata-backed services/operations for a future read-only smoke batch. Its inputs are catalog/registry/confidence/question datasets, and its output is a JSON recommendation list. There is no evidence of live cloud access, command execution, authentication handling, model/image/video generation calls, or change planning beyond test-candidate ranking. This is a materially different primary purpose from the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad operational skill for interacting with Huawei Cloud resources via hcloud CLI and MaaS APIs. In contrast, this code chunk only assembles and outputs an internal maturity audit of planner coverage and boundaries. It contains no live cloud operations, no CLI invocation, no API calls, no credential handling, and no resource analysis beyond local static summaries. This is a materially different primary purpose, so the description does not accurately represent the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

声明描述的是一个范围很广的华为云操作与 MaaS 能力集合,包括 CLI 资源查询/变更执行、MaaS 多模态任务调用、认证排查和执行验证。实际代码仅是一个统一入口脚本:根据 --tier 选择 lifecycle/governance/scenario planner,整理参数并调用其他模块生成 plan,然后输出 JSON。该代码片段没有看到任何 MaaS API 网络调用、模型/图像/视频任务处理、认证诊断逻辑,也没有直接执行 hcloud 命令进行资源查询或变更;最多只是为下游 planner 传递参数并生成计划。因此其实际行为明显比声明狭窄,且缺少声明中的重要能力,构成描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个面向华为云资源操作与 MaaS API 调用的通用技能;但给出的代码块仅实现了一个特定的“服务策展/晋升审计”工具。它分析本地 catalog/registry/profile/confidence 数据,判断服务是否满足 curated promotion 条件,并生成排名和整改建议。没有任何 CLI 调用、网络 API 请求、资源变更、认证处理或 MaaS 多模态任务逻辑。两者的主要目的和能力范围明显不一致,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description promises operational use of hcloud and MaaS APIs for cloud resource querying, analysis, planning, changes, and model/media task invocation. The code chunk instead implements an 'environment doctor' that performs local checks only: Python version, hcloud presence/config hints, credential variable presence, SDK/Terraform/obsutil installation, MaaS API key presence, and proxy variables. It returns a JSON readiness report and explicitly states that it does not install packages, modify credentials, run terraform init/plan/apply, or call Huawei Cloud APIs. While authentication troubleshooting and execution validation are loosely related, the actual code’s primary purpose is materially narrower and different from the declared operational cloud-management/MaaS functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The description substantially overstates the capability of this code chunk. The actual script only generates and optionally executes safe, list-only Huawei Cloud CLI discovery commands. It contains explicit safeguards to avoid mutating operations and directs users to other tools for change planning or parameterized queries. There is no MaaS API integration at all, and no implementation for multimodal model invocation. While the code does fit a subset of the declared description—Huawei Cloud CLI resource querying/command construction/execution for discovery—the declared purpose presents a much broader multi-function skill whose major advertised capabilities are absent from this code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code chunk does not implement cloud operations or MaaS model/media invocation. Its sole purpose is maintaining and summarizing a local run journal. While journaling could be a supporting utility within a larger Huawei Cloud skill, the declared description presents the skill as an execution and planning tool for cloud and MaaS tasks, whereas this code itself only performs JSONL event logging and summary generation. That is a materially different behavior for this supplied code chunk, so this chunk does not accurately match the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

声明描述的是一个可实际操作华为云资源和 MaaS API 的综合技能,而提供的代码仅是 hcloud_scenario_router.py,其职责是把自然语言目标路由到本地参考资料、playbook、planner 和 Terraform 指引。代码行为包括:读取 scenario-router.json 和 service-aliases.json,基于名称、触发词、类别、服务和描述词打分,返回匹配场景和推荐后续脚本;输出中还明确写明“does not install or execute external skills”。因此,该代码块的主要目的与声明存在实质偏差。虽然路由功能可被视为“规划/命令构造”的辅助部分,但声明中最核心的 CLI 执行、云资源操作和 MaaS API 调用能力在此代码中均未体现。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description presents a broad cloud operations skill centered on Huawei Cloud CLI usage and MaaS API interactions. The actual code chunk is narrowly focused on auditing a local SDK supplement registry for compliance rules: it reads a JSON registry, validates entry structure and allowed values, checks fallback runner file existence, compares entries against SDK metadata, and outputs JSON findings. This is a materially different primary purpose and resource scope. While it is loosely related to the hcloud ecosystem, it does not implement the declared cloud execution or MaaS capabilities, so the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个覆盖面很广的华为云操作与 MaaS 调用技能,但实际代码块只是一个离线 JSON 处理器。它从文件读取候选资源数据,排序后生成审查步骤,明确标注 planning_only=True、destructive_action_allowed=False、executable=False、submit_command=None。没有任何 hcloud CLI 子进程调用、网络请求、云资源读取/修改、认证检查或 MaaS 相关逻辑。因此其实际行为与声明的主要能力范围存在显著不一致,属于描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

该代码块的主要用途是为 Terraform 相关资产生成目录索引:遍历 examples/terraform 和 references/terraform 下的文件,解析 README 摘要、匹配资源名前缀、推断服务类别和意图标签,并输出 JSON catalog,必要时写入本地文件。它只进行本地文件系统读取/写入和文本解析。与声明相比,代码没有执行任何 hcloud 或 KooCLI 命令,没有进行华为云认证排查、资源查询、分析或变更,也没有任何 MaaS API 请求、模型调用、图像理解、图片生成/编辑或视频生成逻辑。因此,这不是对所声明核心能力的实现细节,而是一个 materially different primary purpose,应判定为描述与行为不符。

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
- 首选 `python3 scripts/hcloud_environment_doctor.py --pretty` 或 `python3 scripts/hcloud_context_inspect.py --pretty`。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 71)May include surrounding context.

md
- 首选 `python3 scripts/hcloud_environment_doctor.py --pretty` 或 `python3 scripts/hcloud_context_inspect.py --pretty`。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
- 首选 `python3 scripts/hcloud_environment_doctor.py --pretty` 或 `python3 scripts/hcloud_context_inspect.py --pretty`。

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/cbh_stack/main.tf.txt:35

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/dcs_stack/main.tf.txt:39

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/dms_stack/main.tf.txt:44

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/ecs_elb_rds_stack/main.tf.txt:118

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/iam_stack/main.tf.txt:48

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/nat_vpc_peering_stack/main.tf.txt:66

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/oms_stack/main.tf.txt:76

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/rds_mysql_eip_stack/main.tf.txt:58

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/rds_mysql_stack/main.tf.txt:58

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/rds_postgresql_ha_stack/main.tf.txt:61

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/rds_read_replica_stack/main.tf.txt:73

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/rds_sqlserver_stack/main.tf.txt:58

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
examples/terraform/rds_stack/main.tf.txt:56