Back to skill

Security audit

HAP升级指南

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent HAP upgrade-guide generator, but it includes high-impact admin commands that execute remote scripts without integrity verification and can expose MongoDB credentials.

Review this skill before installing in production workflows. If used, do not run generated curl-to-bash commands directly; download scripts, verify them against trusted checksums or signatures, inspect them, and run with least privilege. Avoid putting MongoDB passwords in command lines, and schedule upgrades with backups and rollback plans.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:215
Finding

Unverified Remote Shell Scripts Are Downloaded and Immediately Executed

Content
View full analysis
Remediation
View remediation
' 'preset_mongodb_docker.sh' | sha256sum --check - ``` The expected digest must come from a trusted, independently protected release manifest rather than from the same mutable download location. 3. **Prefer digital signatures.** Have the vendor sign each script or release manifest with a documented signing key. Verify the signature locally and fail closed if verification does not succeed. 4. **Use immutable, version-specific URLs.** Each upgrade version should reference a fixed script artifact rather than a shared mutable filename. Integrity verification must still be required. 5. **Create an inspection and approval boundary.** Download the script to disk, display its source and verified release metadata, and require explicit administrator approval before invoking `bash`. 6. **Apply least privilege.** Run the script under a dedicated maintenance identity with only the Docker or Kubernetes permissions required for the specific update. Avoid unrestricted root or cluster-admin execution where feasible. 7. **Isolate execution.** Where supported, run update tooling in a constrained container or maintenance job with: - A read-only root filesystem - No unnecessary host mounts - No unrestricted host networking - A narrowly scoped service account - Explicit resource and namespace restrictions 8. **Record provenance.** Generated guides should state the exact script version, immutable URL, checksum, signing identity, and verification command so operators can r ...[truncated 445 chars]
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (28)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The description says the skill must trigger whenever the user mentions a wide range of HAP upgrade-related topics, and even when the user does not explicitly invoke the skill, as long as the task is merely 'related' to upgrade decision or execution. This lacks clear boundaries and negative examples, increasing the chance of unintended invocation for adjacent conversations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

L0011 声明升级指南会“自动转换为 HTML 文档”,而后文 L0113、L0812 又写“HTML 由脚本从 Markdown 自动生成”,但 L0910-L0912 明确要求“HTML 完全由 AI 直接生成,不依赖任何本地 Python 脚本”。这不是简单的信息不全,而是对 HTML 生成实现方式的直接冲突,容易导致执行者或代理采用与文档意图不一致的流程。

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

The skill instructs operators to run long-lived nohup mongo ... & commands containing credentials directly in the command line. On many systems, command-line arguments are visible to other local users via process listings and may also be captured in shell history or logs, exposing database credentials and enabling unauthorized database access.

Content

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

md
* 步骤 3:执行脚本(根据 MongoDB 认证配置,提供无认证和有认证两种情况的完整命令)
            ```bash
            # MongoDB 无认证
            nohup mongo mongodb://127.0.0.1:27017/admin --quiet reIndex.js >> reIndex_output.log 2>&1 &

            # MongoDB 有认证(替换 root:password 为实际用户名和密码)
            nohup mongo mongodb://root:password@127.0.0.1:27017/admin --quiet reIndex.js >> reIndex_output.log 2>&1 &

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

This line repeats the same unsafe pattern: a backgrounded mongo invocation with embedded root:password credentials. In an admin-run upgrade skill, this is more dangerous because the commands are likely to be copied verbatim into production environments where multiple admins or monitoring tools may observe the process table.

Content

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

md
nohup mongo mongodb://127.0.0.1:27017/admin --quiet reIndex.js >> reIndex_output.log 2>&1 &

            # MongoDB 有认证(替换 root:password 为实际用户名和密码)
            nohup mongo mongodb://root:password@127.0.0.1:27017/admin --quiet reIndex.js >> reIndex_output.log 2>&1 &
            ```
          * 步骤 4:观察日志(提供观察进度的命令)
            ```bash

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

The skill again prescribes a persistent background command with database credentials in the command line. This can leak secrets through ps, audit logs, or terminal history, and the use of nohup increases the lifetime of the exposed process, enlarging the window for credential disclosure.

Content

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

md
* 步骤 6:执行脚本(根据 MongoDB 认证配置,提供无认证和有认证两种情况的完整命令)
            ```bash
            # MongoDB 无认证
            nohup mongo mongodb://127.0.0.1:27017/admin --quiet reIndexWithCmd.js >> reIndexWithCmd_output.log 2>&1 &

            # MongoDB 有认证(替换 root:password 为实际用户名和密码)
            nohup mongo mongodb://root:password@127.0.0.1:27017/admin --quiet reIndexWithCmd.js >> reIndexWithCmd_output.log 2>&1 &

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

This duplicate credential-in-command-line pattern remains a real issue. Because the skill is an upgrade guide for private deployments, operators may execute it with elevated privileges on sensitive hosts, making any credential exposure materially risky even if the intent is administrative.

Content

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

md
nohup mongo mongodb://127.0.0.1:27017/admin --quiet reIndexWithCmd.js >> reIndexWithCmd_output.log 2>&1 &

            # MongoDB 有认证(替换 root:password 为实际用户名和密码)
            nohup mongo mongodb://root:password@127.0.0.1:27017/admin --quiet reIndexWithCmd.js >> reIndexWithCmd_output.log 2>&1 &
            ```
          * 步骤 7:观察日志(提供观察进度的命令)
            ```bash

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The required HTML template hard-codes lang="zh-CN", which imposes a specific locale in generated output. The file does not offer user opt-in or a language choice, and the locale restriction is not justified as a region-specific compliance requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This HTML template hard-codes the document language as "zh-CN", which imposes a specific locale on all generated output. The file does not offer any user opt-in, locale selection, or context showing that the template is intended only for a China-specific audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill file is written as a Chinese-only upgrade guide template and does not indicate that users may choose another language or that the language restriction is required for a region-specific purpose. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document instructs operators to execute shell scripts fetched directly over the network via curl and bash, which creates a classic remote-code-execution and supply-chain risk if the hosting endpoint, transport path, or referenced script is compromised. In an upgrade skill for private deployments, users are likely to run these commands with elevated privileges on production systems, increasing the blast radius substantially.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The upgrade and restart commands can change running services and potentially cause downtime or partial outages, yet the document does not prominently warn users to assess impact, back up state, and schedule maintenance. In the context of HAP private deployment upgrades, these commands are operationally sensitive and could disrupt production availability if followed blindly.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

Low
Category
Tool Misuse
Confidence
15% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
- **步骤 4**:逐版本升级执行(提供完整的 4 个升级命令,每个命令都必须包含完整的参数)
          ```bash
          # 3.4 到 3.6
          docker run -i --rm -v /data/mingdao/script/volume/data/mongodb:/data/mongodb registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-sc-upgrade:1.0.0 <<< 'upgradeMongodb.sh 3.4 3.6'

          # 3.6 到 4.0
          docker run -i --rm -v /data/mingdao/script/volume/data/mongodb:/data/mongodb registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-sc-upgrade:1.0.0 <<< 'upgradeMongodb.sh 3.6 4.0'

Tool Parameter Abuse

Low
Category
Tool Misuse
Confidence
15% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
- **步骤 4**:逐版本升级执行(提供完整的 4 个升级命令,每个命令都必须包含完整的参数)
          ```bash
          # 3.4 到 3.6
          docker run -i --rm -v /data/mingdao/script/volume/data/mongodb:/data/mongodb registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-sc-upgrade:1.0.0 <<< 'upgradeMongodb.sh 3.4 3.6'

          # 3.6 到 4.0
          docker run -i --rm -v /data/mingdao/script/volume/data/mongodb:/data/mongodb registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-sc-upgrade:1.0.0 <<< 'upgradeMongodb.sh 3.6 4.0'

Tool Parameter Abuse

Low
Category
Tool Misuse
Confidence
15% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
- **步骤 4**:逐版本升级执行(提供完整的 4 个升级命令,每个命令都必须包含完整的参数)
          ```bash
          # 3.4 到 3.6
          docker run -i --rm -v /data/mingdao/script/volume/data/mongodb:/data/mongodb registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-sc-upgrade:1.0.0 <<< 'upgradeMongodb.sh 3.4 3.6'

          # 3.6 到 4.0
          docker run -i --rm -v /data/mingdao/script/volume/data/mongodb:/data/mongodb registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-sc-upgrade:1.0.0 <<< 'upgradeMongodb.sh 3.6 4.0'

Static analysis

No suspicious patterns detected.