Back to skill

Security audit

云迁移CMG

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a real cloud-migration helper, but it asks users to use powerful cloud credentials with downloaded scanners, global installs, and generated reports that need careful review before use.

Install only if you trust the publisher and the user-supplied MCP server, and run it with isolated, least-privilege, preferably short-lived cloud credentials. Do not use AWS root or broadly privileged main-account keys. Avoid passing secrets on command lines, treat generated JSON/Excel/HTML reports as sensitive, and consider reviewing or sandboxing the downloaded scanner binaries before use.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (7)

T08 · Insecure Dependencies

Error
Location
scripts/fetch_scanner.sh:25
Finding

Unsigned Precompiled Scanner Processes Production Cloud Credentials

Content
View full analysis
/dev/null; then ACTUAL=$(sha256sum "$TMP" | cut -d' ' -f1) else ACTUAL=$(shasum -a 256 "$TMP" | cut -d' ' -f1) fi if [ "$ACTUAL" != "$EXPECTED" ]; then fail "校验和不匹配 — 已丢弃下载内容" exit 1 fi mv "$TMP" "$DEST/$FILE" ``` The documentation then instructs users to execute the extracted binary with cloud credentials: ```bash ./aliyun-scanner ``` The checksum manifest explicitly states that the values were calculated by the maintainer from files downloaded from the same COS location and that the upstream publisher did not provide signatures or an official checksum manifest. ### Technical Analysis The downloader correctly uses HTTPS, requires TLS 1.2 or later, and fails closed when a SHA-256 value is missing or mismatched. These controls protect against later accidental corruption or replacement of the pinned artifact. They do not establish the provenance or trustworthiness of the original executable. The binary is: - Precompiled and not auditable from the project source. - Unsigned by an independently authenticated publisher. - Expected to receive cloud credentials. - Expected to enumerate production cloud resources. - Trusted using hashes generated from the same remote artifacts rather than an independent release-signing channel. Consequently, a malicious original build, compromised publisher account, or compromised maintainer release process could produce a binary that performs the advertised scan while also collecting credentials or infrastructure information. The flagged ne ...[truncated 1379 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/scan.md:143
Finding

AWS Root or Main Account Credentials Are Required for Resource Scanning

Content
View full analysis
⚠️ **必须使用主账号扫描**,子账号即使有权限也会导致结果不完整。 ```yaml SecretId: 这里填写你的SecretId SecretKey: 这里填写你的SecretKey Regions: Products: ec2 ``` ``` ### Technical Analysis The documentation instructs users to use an AWS “main account” rather than a subordinate identity. If interpreted as the AWS root user, this directly violates AWS security guidance and the principle of least privilege. Resource inventory does not legitimately require unrestricted root credentials. Inventory should be performed through a dedicated read-only IAM role with only the necessary `List*`, `Describe*`, and `Get*` actions. The risk is amplified because these credentials are supplied to a downloaded, precompiled scanner whose source is not included in the project. Requiring the most privileged account identity exceeds the minimum permissions necessary for resource discovery. ### Attack Path 1. A user follows the scanning documentation. 2. The user creates or supplies credentials associated with the AWS root or broadly privileged main account. 3. The user stores those credentials in the scanner's plaintext `config.yaml`. 4. The precompiled scanner reads the credentials during startup. 5. If the scanner is malicious or compromised, it uses or discloses credentials with account-wide authority. 6. The attacker authenticates to AWS and performs operations unconstrained by a dedicated scanning policy. ### Impact Assessment If root or equivalent administrative credentials are compromised, the attacker may be able to: - Read, create, modify, or delete cloud resources. - Access sensitive storage and databases. - Modify IAM users, roles, and policies. - Disable security monitoring. - Change billing or account settings. - Establish persistent cloud access. - Cause complete AWS account t ...[truncated 90 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/tco_pricing.py:577
Finding

Cloud Access Key Secret Is Passed Through Process Arguments

Content
View full analysis
\ --sk \ --region cn-hangzhou \ --title "XX项目迁移TCO分析" \ --output-dir /tmp/tco_output ``` ```python parser.add_argument("--ak", help="源端 AccessKey ID") parser.add_argument("--sk", help="源端 AccessKey Secret") ``` ### Technical Analysis Passing an access key secret on the command line exposes it outside the Python process. Depending on the operating system and execution environment, command-line arguments may be visible through: - Process enumeration tools. - `/proc` process metadata. - Shell history. - Terminal recording. - CI/CD job logs. - Endpoint monitoring and process telemetry. - Agent command transcripts. The script does not print the secret directly, and the Aliyun request implementation uses it locally to calculate an HMAC signature. Nevertheless, exposing the secret through `argv` is avoidable and violates secure credential-handling practices. The pre-scan's Base64 alert is not itself malicious: `base64.b64encode(h.digest())` encodes an HMAC digest required by the Aliyun signature protocol. The secret key is not Base64-encoded into the output. The vulnerability is the documented secret-input channel. ### Attack Path 1. The user runs the documented command with a real access key secret. 2. The shell records the command in its history, or the process exposes it through process metadata. 3. A local user, monitoring agent, CI log reader, or later forensic reader retrieves the argument. 4. The attacker obtains the access key ID and secret. 5. The attacker authenticates to Aliyun using the permissions assigned to that identity. ### Impact Assessment The attacker gains the privileges of the exposed cloud identity. The lik ...[truncated 259 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/tco_report.py:396
Finding

Unescaped Cloud Metadata Enables Stored Script Injection in HTML Reports

Content
View full analysis
{v_display} {item.get('product', '')} {item.get('resource_name', '')} {item.get('region', '')} {item.get('spec_summary', '')} {item.get('notes', '')} """ html = f""" {project_name}

{project_name}

... {detail_rows_html} """ with open(output_path, "w", encoding="utf-8") as f: f.write(html) ``` Product and vendor values are also inserted into HTML or JavaScript contexts without context-appropriate encoding. ### Technical Analysis The report generator treats fields from `pricing_data.json` as trusted HTML. These fields can originate from: - User-supplied JSON. - Cloud resource names and tags. - Scanner output. - Remote recommendation results. - Error and notes fields. No HTML escaping is applied before values are placed into the document. An attacker who controls a resource name, product name, project title, region, specification, or note can close the intended HTML element and insert executable markup. For example, a resource name containing an image element with an `onerror` handler will become active markup when a user opens the report. Th ...[truncated 1328 chars]
Remediation
View remediation
`, `&`, Unicode line separators, and closing script sequences. 4. Never insert remote MCP output or cloud metadata as raw markup. 5. Add a restrictive Content Security Policy, preferably with scripts bundled locally and allowed by hashes or nonces. 6. Add regression tests using payloads in every externally sourced field. 7. Consider generating a script-free report variant for sensitive environments. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tco_report.py:228
Finding

Cloud Metadata Can Be Interpreted as Spreadsheet Formulas

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/setup.sh:255
Finding

Global npm Package Is Installed Without Version or Integrity Pinning

Content
View full analysis
/dev/null; then warn "mcporter 未安装,需要全局安装(会修改全局 npm 环境)" if ! confirm "执行 npm install -g mcporter?"; then fail "已取消。可手动安装后重新运行:npm install -g mcporter" exit 1 fi echo "正在安装 mcporter..." npm install -g mcporter --no-progress 2>&1 | tail -3 if command -v mcporter &>/dev/null; then ok "mcporter 全局安装完成" else fail "mcporter 安装失败,请手动执行: npm install -g mcporter" exit 1 fi fi ``` ### Technical Analysis The setup script installs the latest package associated with the `mcporter` package name. It does not pin: - An exact version. - A package integrity hash. - A lockfile. - A specific registry. - A reviewed dependency graph. The installation is global, so the package's installation scripts and executable affect the user's broader Node.js environment. Although the script requests confirmation and accurately discloses that it modifies the global environment, confirmation does not mitigate package-registry compromise or a malicious future release. The project also suppresses most installation output by retaining only the last three lines, reducing visibility into warnings or lifecycle-script activity. ### Attack Path 1. The npm package, a transitive dependency, maintainer account, or registry resolution path is compromised. 2. A user runs `setup.sh` when `mcporter` is absent. 3. The user confirms the documented global installation. 4. npm resolves the current package version rather than an audited pinned version. 5. Malicious lifecycle code executes during installation or the installed command runs attacker code later. 6. The code operates with the permissions of the user running setup and may modify the global Node.js environment or user files. ### Impact Assessment A compromised package may: - Execute arbitrary code as th ...[truncated 298 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/tco_report.py:453
Finding

Generated Reports Execute Unpinned Third-Party JavaScript from a CDN

Content
View full analysis
{project_name} ``` The loaded library is then trusted to process report data: ```javascript new Chart(productCtx, { type: 'bar', data: { labels: PRODUCT_LABELS, datasets: [...] } }); new Chart(document.getElementById('vendorChart'), { type: 'doughnut', data: { labels: VENDOR_LABELS, datasets: [...] } }); ``` ### Technical Analysis Every generated HTML report contacts Google Fonts and jsDelivr when opened. The Chart.js URL includes a version but has no Subresource Integrity attribute, and the document contains no Content Security Policy. The report may contain sensitive production inventory and pricing data. Loading external active content creates an avoidable third-party trust dependency at report-view time. If the CDN, package publication path, DNS resolution, or browser trust chain is compromised, attacker-controlled JavaScript can run in the report. Even without compromise, opening the report discloses metadata such as the viewer's IP address, user agent, and access time to external providers. ### Attack Path 1. An attacker compromises the CDN delivery path or the package artifact served at the referenced URL. 2. A user opens a generated TCO HTML report while connected to the network. 3. The browser downloads and executes the remote script because no integrity attribute restricts its contents. 4. The malicious script reads report DOM content. 5. T ...[truncated 557 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

声明描述的是一个覆盖扫描、清单、推荐、映射、成本与报价的“全流程”迁移能力集合;但实际代码只完成其中很窄的一部分:对已有扫描结果做依赖拓扑分析和迁移波次分组。它不会调用云平台 API 扫描资源,不会生成腾讯云产品映射或规格推荐,也不涉及任何价格/TCO 计算。虽然该脚本与“迁移”领域相关,可视为 CMG 流程中的配套分析环节,但其主要功能与声明的核心能力集合相比明显偏窄且不同,因此属于描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个面向最终用户的迁移分析与推荐能力集合,而代码实际只覆盖了一个很窄的运维/供应链辅助功能:下载扫描器二进制包并做完整性校验。两者主目的明显不同。代码没有体现任何云 API 调用、资源扫描、清单生成、推荐引擎、价格计算或 TCO 逻辑;相反,它访问的是固定发布包存储地址和本地校验和清单,用于获取工具本身。这可以视为支持性组件,但如果用这段代码来代表整个技能描述,则描述显著夸大了实际行为,因此应判定为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description promises substantive migration-platform business capabilities: scanning multi-cloud resources, generating inventories, mapping to Tencent Cloud products/specs, and performing cost/TCO analysis. The actual code chunk is instead an installer/configuration helper. Its primary purpose is to prepare a local client environment for a remote MCP server by checking Node/npm/mcporter, optionally running 'npm install -g mcporter', writing ~/.mcporter/mcporter.json, and sending an initialize request to test connectivity. While this setup script is related to the broader recommendation skill, the code shown does not implement the declared end-user capabilities and introduces a materially different primary behavior: local system setup/configuration. Therefore the description does not accurately represent what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description promises broad end-to-end migration-platform functionality, including resource scanning across multiple clouds, inventory generation, Tencent Cloud benchmarking/recommendation, and pricing/TCO analysis. The actual code only loads an XLSX workbook with openpyxl, looks for columns containing '地域', derives a product name from sheet names, counts rows, and prints aggregate counts by product and region. This is at most a small post-processing utility for scan outputs, not the described end-to-end migration skill. While it is loosely related to scan-result handling, the primary purpose is materially narrower than declared, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code substantially matches a subset of the description: it does resource scanning, Tencent benchmarking/mapping, spec recommendation, and TCO/pricing analysis. However, the declared purpose describes a much broader end-to-end CMG/MSP capability and explicitly names scanning of Aliyun/AWS/Huawei/GCP resources. In the supplied code, only Aliyun scanning is implemented, and even the CLI notes that only aliyun is currently supported. The actual behavior is limited mainly to Aliyun ECS discovery, Aliyun pricing, Tencent CVM price inquiry, and report generation. This is a material description-to-behavior mismatch due to overstated breadth and unsupported vendor coverage.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'file_write' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The script performs outbound network access to Aliyun APIs and indirectly to Tencent Cloud via tccli, while the finding states this capability is not declared in permissions. In an agent skill context, undeclared network access is dangerous because it can transmit cloud inventory, pricing inputs, and credential-derived signed requests outside the expected permission model, undermining user consent and sandbox assumptions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest includes very broad trigger phrases such as ‘帮我推荐/给我推荐,’ which can match ordinary user requests unrelated to cloud migration. This can cause accidental activation of a skill that reads migration docs, prompts for external server URLs, or steers users into environment-changing setup flows, increasing the risk of unintended data exposure or tool use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. This markdown file presents all operational and safety instructions only in Chinese, which effectively forces a specific language on users without stating that the skill is region-specific or offering an alternative language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guidance explicitly tells operators to configure source AK/SK and connection information for migration tasks but provides no warning about secure handling, least-privilege scoping, masking, storage, or rotation of those secrets. In a cloud migration context, these credentials can grant broad access to source storage or databases, so omission of security guidance increases the risk of credential leakage, over-privileged access, and compromise of source or destination environments.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill is presented as a recommendation capability, but it instructs the agent to run setup scripts, install a global package, write persistent configuration under the user's home directory, and save output files locally. Even with user confirmation language, this expands the trust boundary from read-only recommendation to host modification and data persistence, which creates security and privacy risk if the remote server or setup path is misused.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire skill documentation, including operational instructions, warnings, and examples, is written only in Chinese. This imposes a specific language/locale on users without opt-in or an explicit justification that the skill is intended solely for a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document is entirely written as mandatory Chinese-language operating guidance and includes locale-specific settings such as a Chinese-language GCP calculator URL, without indicating that users may choose another language. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs operators to supply cloud AK/SK credentials on command lines and to authenticate CLI tooling, but provides no guidance on secure secret handling, least privilege, masking, storage, or cleanup. This can expose long-lived credentials through shell history, process lists, logs, screenshots, shared terminals, or generated artifacts, enabling unauthorized access to cloud environments.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Lines L003-L017 and L639-L652 establish a strict rule that all prices must come from real API queries or official calculators and must never be estimated or inferred. However, L231-L244 introduces '大致包月单价' reference pricing, which contradicts that stated intent by embedding non-authoritative estimated prices into the guidance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script's natural-language strings, usage, help text, and status output are consistently Chinese-only, which imposes a language choice without any opt-in or alternative locale. The policy calls for flagging language or locale constraints when the skill forces a specific language without user choice or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This shell script contains natural-language instructions, usage text, and warnings exclusively in Chinese, and later user-facing output continues in Chinese. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/setup.sh (reported line 169)May include surrounding context.

sh
# Streamable HTTP 协议:POST /mcp 发送 initialize 请求验证连通性
  local mcp_url="${url%/}/mcp"
  local response
  response=$(curl -s --max-time 5 -X POST "$mcp_url" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json, text/event-stream" \
    -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"setup","version":"1.0"}}}' \

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file's natural-language interface, help text, and output strings are written exclusively in Chinese, which effectively forces a specific language for users. The file does not offer language selection or explain that it is intentionally restricted to a Chinese-speaking or region-specific audience.

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/tco_pricing.py (reported line 241)May include surrounding context.

python
args.extend([f"--{k}", str(v)])

    try:
        result = subprocess.run(args, capture_output=True, text=True, timeout=30)
        if result.returncode != 0:
            print(f"  ⚠️ tccli 错误: {result.stderr.strip()}")
            return {"Error": result.stderr.strip()}

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The argument help advertises aws and huawei as selectable source vendors, while the accompanying text says only Aliyun is currently supported and the code paths actually implement scanning and source-side pricing only for Aliyun. This is active documentation/interface contradiction that can mislead users about the skill's real capabilities.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The tool accepts cloud access keys and performs resource scanning and pricing queries without a clear execution-time warning that account metadata and pricing-related parameters will be sent to external cloud APIs. In a migration-assessment skill, this context increases sensitivity because users may provide production credentials, and the scan can enumerate infrastructure details that are operationally sensitive even if TLS is enabled.

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/tco_pricing.py (reported line 658)May include surrounding context.

python
"--title", args.title,
                "--output-dir", args.output_dir,
            ]
            subprocess.run(cmd, check=True)
        else:
            print(f"⚠️ 报告脚本未找到: {report_script}")

Unbounded Output

Medium
Category
Output Handling
Confidence
75% confidence
Finding

Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.

Content

Scanner excerpt · scripts/tco_report.py (reported line 205)May include surrounding context.

python
def _auto_width(ws: Any) -> None:
    """自动列宽"""
    for col in ws.columns:
        max_length = 0
        col_letter = get_column_letter(col[0].column)
        for cell in col:
            if cell.value:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire skill file is written in Chinese, beginning with the title at L001 and continuing throughout all product descriptions. Under the stated policy, a skill that forces a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.