T09 · Insecure Skill Coding Practices
- 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: HighVulnerable 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=jsontext 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
- Never invoke
UpgradeCluster,UpgradeNodePool,UpdateAddonInstance, or other mutating APIs while generating an assessment or preview. - Render upgrade commands only as inert Markdown or structured text until the user explicitly approves execution.
- 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 ofconfirm=true. - 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.
- Use read-only operations such as
ShowCluster,ListClusterUpgradePaths,ShowClusterUpgradeInfo, and list APIs for assessment wherever possible. - Clearly label
CreateUpgradeWorkFlowaccording to its verified API behavior. If it can initiate mutating phases, do not use it as a read-only pre-check. - Remove the unsupported statement
without confirm=true, no executionfrom both language variants and all references unless authoritative CLI documentation confirms that behavior. - Add automated linting or tests that reject execution-preview examples containing mutating CCE operations without a verified dry-run mechanism.
- Apply least-privilege credentials for assessment workflows so the active profile can read cluster state but cannot initiate upgrades.
- Never invoke
