T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/huawei_cloud/dispatcher.py:1470- Finding
Undeclared destructive and remediation actions exposed by a read-only metric Skill
- Content
View full analysis
Vulnerability Details
File Location:
scripts/huawei_cloud/dispatcher.py:183-269, 1470-1500, 1532-1535, 1601-1602; mutation sinks inscripts/huawei_cloud/cce.py:165-225, 431-495, 834-973, 1512-2143, 4230-4489
Vulnerability Type: Least-privilege violation and undeclared cloud-resource mutation
Risk Level: HighThe Skill declares itself strictly read-only in
SKILL.md:293-301, but its advertised dispatcher exposes operations that delete, resize, scale, drain, roll back, and otherwise modify Huawei Cloud and Kubernetes resources.Vulnerable Code
scripts/huawei_cloud/dispatcher.py:183-219:python def _delete_cce_cluster(params: Dict[str, str]) -> Dict[str, Any]: return cce.delete_cce_cluster(params["region"], params["cluster_id"], params.get("confirm", "").lower() == "true", params.get("delete_evs", "").lower() == "true", params.get("delete_net", "").lower() == "true", params.get("delete_obs", "").lower() == "true", params.get("ak"), params.get("sk"), params.get("project_id")) def _delete_cce_node(params: Dict[str, str]) -> Dict[str, Any]: return cce.delete_cce_node(params["region"], params["cluster_id"], params["node_id"], params.get("confirm", "").lower() == "true", params.get("scale_down", "true").lower() == "true", params.get("ak"), params.get("sk"), params.get("project_id")) def _resize_cce_nodepool(params: Dict[str, str]) -> Dict[str, Any]: scale_group_names = None if params.get("scale_group_names"): scale_group_names = [name.strip() for name in params["scale_group_names"].split(",") if name.strip()] return cce.resize_node_pool(params["region"], params["cluster_id"], params["nodepool_id"], int(params["node_count"]), params.get("confirm", "").lower() == "true", scale_group_names, params.get("ak"), params.get("sk"), params.get("project_id"))scripts/huawei_cloud/dispatcher.py:249-269:python def _scale_cce_workload(params: Dict[str, str]) -> Dict[st ...[truncated 5197 chars]- Remediation
View remediation
Remediation Suggestions
- Remove every mutation, deletion, remediation, rollback, scaling, drain, and alarm-management action from this Skill's dispatcher.
- Implement a dispatcher-level allowlist containing only the documented metric-query actions.
- Move remediation functionality into a separately named and separately distributed Skill.
- Give the metric Skill a dedicated IAM identity with read-only AOM, CES, and narrowly scoped CCE inventory permissions.
- Deny Kubernetes write verbs in the Skill's RBAC policy.
- For a separate write-capable Skill, require an out-of-band approval token bound to the exact action, resource, parameters, and expiration time.
- Update the documentation and permission table so they accurately describe the complete callable surface.
- Add automated tests that fail if any non-read-only handler is registered in the metric dispatcher.
