Back to skill

Security audit

Huawei Cloud Cce Cluster Upgrade Planner

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent CCE upgrade planner, but it needs Review because its preview sections include live cloud upgrade commands that could change production clusters.

Review before installing. Use read-only or least-privileged Huawei Cloud credentials for assessment, verify hcloud dry-run behavior independently, and do not allow the agent to run UpgradeCluster, CreateUpgradeWorkFlow, UpgradeNodePool, UpdateAddonInstance, pause, retry, continue, or cancellation commands unless you have explicitly approved that exact cluster, region, version, and operation.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:154
Finding

Mutating CCE Upgrade Command Is Misrepresented as a Safe Preview

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 154–169
Vulnerability Type: Unsafe execution of a destructive cloud operation
Risk Level: High

Vulnerable Code

bash
### Step 5: Upgrade Execution Preview

```bash
# Preview cluster upgrade (without confirm=true, no execution)
hcloud CCE UpgradeCluster \
  --cluster_id=<cluster-id> \
  --metadata.apiVersion=v3 \
  --metadata.kind=UpgradeTask \
  --spec.clusterUpgradeAction.targetVersion=<target-version> \
  --spec.clusterUpgradeAction.strategy.type=inPlaceRollingUpdate \
  --spec.clusterUpgradeAction.strategy.inPlaceRollingUpdate.userDefinedStep=20 \
  --spec.clusterUpgradeAction.strategy.inPlaceRollingUpdate.scope=Cluster \
  --cli-region=<region> \
  --cli-output=json
text

The same unsafe pattern is repeated in `SKILL-CN.md`, lines 138–149, and `references/upgrade-workflow.md`, lines 106–130. The ineffective prose-only guardrails appear in `SKILL.md`, lines 42–58, `references/upgrade-workflow.md`, line 146, and `references/risk-rules.md`, lines 117–118.

### Technical Analysis

The command presented as an “execution preview” directly invokes `hcloud CCE UpgradeCluster`. The project itself identifies this operation as critical and states that a control-plane upgrade is irreversible once started.

The displayed command contains no documented dry-run, preview, or non-mutating parameter. In particular, the comment claims that omitting `confirm=true` prevents execution, but no evidence in the audited files establishes that omission of such a parameter changes `UpgradeCluster` into a read-only operation. A textual warning or a `confirmation_required` output field does not technically prevent an agent from submitting the command.

This creates a dangerous mismatch between the command’s actual mutating purpose and its documented safety semantics. An agent following the Skill may execute the command to generate the promised preview and uni
...[truncated 1972 chars]
Remediation
View remediation

Remediation Suggestions

  1. Never invoke UpgradeCluster, UpgradeNodePool, UpdateAddonInstance, or other mutating APIs while generating an assessment or preview.
  2. Render upgrade commands only as inert Markdown or structured text until the user explicitly approves execution.
  3. If Huawei Cloud documents an actual dry-run facility, use it explicitly and verify the exact parameter with hcloud CCE UpgradeCluster --help. Do not infer dry-run behavior from the absence of confirm=true.
  4. Implement confirmation as an enforced control-flow boundary immediately before the tool call:
    • Generate and display the command.
    • Display the target cluster, region, version, affected components, and risks.
    • Request explicit confirmation for that exact operation.
    • Validate that the confirmation still matches the command parameters.
    • Execute only after confirmation.
  5. Use read-only operations such as ShowCluster, ListClusterUpgradePaths, ShowClusterUpgradeInfo, and list APIs for assessment wherever possible.
  6. Clearly label CreateUpgradeWorkFlow according to its verified API behavior. If it can initiate mutating phases, do not use it as a read-only pre-check.
  7. Remove the unsupported statement without confirm=true, no execution from both language variants and all references unless authoritative CLI documentation confirms that behavior.
  8. Add automated linting or tests that reject execution-preview examples containing mutating CCE operations without a verified dry-run mechanism.
  9. Apply least-privilege credentials for assessment workflows so the active profile can read cluster state but cannot initiate upgrades.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill claims a safe two-step preview/confirm flow, but its documented 'preview' relies on upgrade APIs such as UpgradeCluster and CreateUpgradeWorkFlow that are themselves mutating or may initiate irreversible upgrade workflow state. In an upgrade-planning skill, this mismatch is especially dangerous because users and agents may trust the label 'preview' and trigger real cluster changes, causing production disruption or irreversible control-plane upgrades.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · references/pre-upgrade-checklist.md (reported line 30)May include surrounding context.

md
| 12 | 节点磁盘检查 | Key data disk usage meets requirements; /tmp has ≥500MB free | Clean disk space, remove unused images |
| 16 | 节点内存检查 | Node memory usage must be < 90% | Reduce workload or add nodes |
| 19 | 节点CPU数量检查 | Control node CPU cores must be > 2 | Upgrade control node flavor |
| 49 | 节点Sudo检查 | sudo command and related files must be normal | Fix sudo configuration |
| 62 | 集群镜像数量检查 | Node image count should not exceed 1000 (Docker slow start risk) | Clean unused images: `docker image prune` |
| 67 | 节点镜像层数量检查 | Image layers should not exceed 5000 | Clean unused images |
| 69 | 轮转证书文件数量检查 | Certificate files on node should not exceed 1000 (slow upgrade risk) | Remove unnecessary certificates |

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest description and main skill content are entirely written in Chinese and identify the skill as a Chinese cloud upgrade assessment skill, but nowhere indicate that users may choose another language. Under the stated policy, a skill that effectively mandates a specific language without opt-in should be flagged unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Although the document declares a two-step confirmation safeguard, later sections provide direct executable upgrade and workflow control commands without carrying that guardrail into each operational procedure. In practice, an agent or operator may treat these as ready-to-run commands and bypass the intended confirmation boundary, leading to unintended upgrades, pauses, retries, or cancellations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill is presented as an upgrade planning and evaluation tool, but it embeds live state-changing commands such as UpgradeCluster, CreateUpgradeWorkFlow, pause/continue/retry task operations, and workflow cancellation. In an agent setting, this blurs the boundary between assessment and execution, increasing the chance that a user request for planning could trigger real cluster mutations with availability impact or irreversible upgrade steps.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
### Credential Security

- **Never expose AK/SK values** in conversation, commands, or output
- **Never ask user to input AK/SK directly** in conversation
- **Only use** `hcloud configure list` to check credential status (presence only, not values)
- **Prefer** profile mode or environment variables over explicit AK/SK parameters

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation states that addons must be upgraded after the cluster reaches the target version, yet the example embeds addon upgrades inside the UpgradeCluster command. That inconsistency can cause operators or agents to perform unsupported or poorly sequenced upgrades, increasing the chance of addon incompatibility, failed upgrades, or control-plane/workload instability.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The schema embeds concrete cluster and node upgrade commands that can directly modify production CCE resources, but presents them as ordinary output data without an explicit warning, dry-run marker, or confirmation requirement. In an agent setting, downstream tools or users may treat these command strings as ready-to-run instructions, increasing the chance of accidental disruptive execution during planning workflows.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/pre-upgrade-checklist.md (reported line 5)May include surrounding context.

md
Source: [升级前检查项](https://support.huaweicloud.com/usermanual-cce/cce_10_0549.html)

CCE automatically runs these 76 pre-check items before allowing upgrade. If any item fails, upgrade is blocked until fixed.

## Checklist Categories

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/pre-upgrade-checklist.md (reported line 30)May include surrounding context.

md
| 12 | 节点磁盘检查 | Key data disk usage meets requirements; /tmp has ≥500MB free | Clean disk space, remove unused images |
| 16 | 节点内存检查 | Node memory usage must be < 90% | Reduce workload or add nodes |
| 19 | 节点CPU数量检查 | Control node CPU cores must be > 2 | Upgrade control node flavor |
| 49 | 节点Sudo检查 | sudo command and related files must be normal | Fix sudo configuration |
| 62 | 集群镜像数量检查 | Node image count should not exceed 1000 (Docker slow start risk) | Clean unused images: `docker image prune` |
| 67 | 节点镜像层数量检查 | Image layers should not exceed 5000 | Clean unused images |
| 69 | 轮转证书文件数量检查 | Certificate files on node should not exceed 1000 (slow upgrade risk) | Remove unnecessary certificates |

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/pre-upgrade-checklist.md (reported line 45)May include surrounding context.

md
| 35 | 节点ID文件检查 | Node ID file content must match expected format | Fix ID file |
| 36 | 节点配置一致性检查 (v1.19+) | K8s component config files should not be manually modified (v1.19+ upgrade) | Use CCE config management instead of direct file edits |
| 37 | 节点配置文件检查 | Key component config files must exist | Restore missing config files |
| 39 | 节点关键目录文件权限检查 | Root directory permissions must be correct | Fix permissions: `chmod 755 /` |
| 40 | 节点关键命令检查 | Upgrade-required commands must execute normally | Ensure standard system commands work |
| 50 | 节点系统参数检查 | Node sysctl parameters must match expected values | Reset sysctl to CCE defaults |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/risk-rules.md (reported line 117)May include surrounding context.

md
## Guardrails

1. **Assessment only**: This skill generates assessment reports and execution previews. It does NOT auto-execute upgrade commands.
2. **Two-step confirmation**: All execution preview commands require explicit user confirmation (`confirm=true` equivalent) before actual execution.
3. **No modification during upgrade**: Do not change cluster specs, node pools, or addons while upgrade is in progress.
4. **Rollback plan required**: Every upgrade plan must include a rollback strategy before starting execution.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file references Huawei Cloud documentation using Chinese-language link text ('CCE集群升级'), and similar Chinese-only references appear later. Because the document does not offer an English alternative or explain that the skill is intentionally China-region-specific, it can be read as imposing a specific language/locale without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The lifecycle verification step points users to a Chinese-language reference ('CCE集群版本生命周期') without documenting that the skill is region-specific or providing a language choice. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The example output includes natural-language values in both Chinese and English, such as Chinese check names alongside English descriptions, without stating whether output language is configurable or fixed. This can violate language/locale policy expectations when a skill implicitly forces or mixes locales without user choice or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The document cites and centers a Chinese-language source title ("升级前检查项") while the file otherwise targets a general audience, and there is no note about language expectations, translation availability, or locale-specific scope. This can create an implicit language constraint without user opt-in, which matches the language/locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The instruction references the column name "支持升级到的Kubernetes版本号" directly, which imposes a specific language in the workflow guidance. This is a natural-language locale constraint without any user opt-in or documented justification that the skill is intended only for Chinese-language materials.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.