Back to skill

Security audit

Alibabacloud Compute Provision

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its cloud-compute purpose, but it needs Review because default workflows can expose SSH publicly and can delete reused Kubernetes resources without ownership checks.

Use this only with a tightly scoped Alibaba Cloud RAM identity and avoid production accounts until the ACK cleanup and ECS SSH defaults are fixed. Do not use ACK create_and_run with auto_cleanup=True on reusable clusters, use unique Kubernetes Job names and namespaces, and do not enable public ECS bandwidth unless inbound SSH is disabled or restricted to your own CIDR. Review scripts before execution and consider preinstalling dependencies from a trusted package source.

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 (4)

T08 · Insecure Dependencies

Warning
Location
scripts/bootstrap.py:15
Finding

Mandatory Dependency Installation Without Integrity Verification

Content
View full analysis
None: """Check Python version and install missing pip packages. Call this once at the start of a session before any API work. Raises SystemExit if the Python version is too old. """ if sys.version_info < _MIN_PYTHON: sys.exit( f"Python >= {_MIN_PYTHON[0]}.{_MIN_PYTHON[1]} is required, " f"but current version is {sys.version.split()[0]}." ) missing: list[str] = [] for import_name, pip_spec in _REQUIRED_PACKAGES: try: __import__(import_name) except ImportError: missing.append(pip_spec) if missing: print(f"Installing missing packages: {', '.join(missing)}") # only install packages in _REQUIRED_PACKAGES, these packages are Alibaba Cloud's official SDK. subprocess.check_call( [sys.executable, "-m", "pip", "install", *missing], stdout=subprocess.DEVNULL, ) ``` ### Technical Analysis The bootstrap routine automatically installs packages from the pip index selected by the host environment. Package versions are pinned, which reduces accidental version drift, but the installation does not use cryptographic package hashes or an explicitly controlled package repository. The Skill instructions require this bootstrap operation to run before API work. Consequently, an attacker who controls the effective pip configuration, a configured mirror, DNS or repository infrastructure, or a package release channel could potentially substitute a malicious distribution with the expected packa ...[truncated 1342 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ecs.py:603
Finding

Enabling Public Bandwidth Automatically Exposes SSH to the Entire Internet

Content
View full analysis
dict: """Add an ingress rule to a security group.""" params: dict[str, Any] = { "SecurityGroupId": security_group_id, "IpProtocol": ip_protocol, "PortRange": port_range, "SourceCidrIp": source_cidr_ip, "Policy": "Accept", } return _call("AuthorizeSecurityGroup", params, region) ``` Instance provisioning invokes that helper without overriding the unrestricted source: ```python sg_id = create_security_group(vpc_id=vpc_id, region=region) authorize_security_group_egress(security_group_id=sg_id, region=region) if internet_max_bandwidth_out > 0: authorize_security_group( security_group_id=sg_id, port_range="22/22", region=region ) ``` ### Technical Analysis When `internet_max_bandwidth_out` is greater than zero, the instance receives public network connectivity and the Skill automatically creates an inbound TCP/22 rule. Because no `source_cidr_ip` is supplied, the helper defaults to `0.0.0.0/0`. Public outbound connectivity does not require inbound SSH access. The Skill executes commands through Alibaba Cloud Cloud Assistant, so SSH is also unnecessary for its standard script-execution workflow. The rule therefore exceeds the minimum network privileges required by the declared functionality. This behavior contradicts the project’s own reference guidance, which says management ports should be restricted to an operator address such as a `/32`. ### Attack Path 1. A user requests public bandwidth, such as to download packag ...[truncated 1034 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/ack.py:734
Finding

Default ACK Cleanup Can Delete a Reused Cluster

Content
View full analysis
str: """Find an existing running cluster or create a new one.""" clusters = describe_clusters( name=cluster_name, cluster_type=cluster_type, region=region, ) for c in clusters: if c.get("state") == "running" and c.get("name") == cluster_name: cluster_id = c["cluster_id"] if _check_cluster_rbac(cluster_id, region): print( f"Reusing existing cluster (name match): " f"{cluster_id} ({cluster_name})" ) return cluster_id ``` The convenience workflow enables cleanup by default but does not know whether the returned cluster was reused: ```python def create_and_run( script_content: str, cluster_name: str = "acf-cluster", vpcid: str | None = None, vswitch_ids: list[str] | None = None, zone_id: str | None = None, worker_instance_types: list[str] | None = None, num_of_nodes: int = 1, image: str | None = None, script_type: str = "shell", auto_cleanup: bool = True, endpoint_public_access: bool = False, region: str | None = None, ) -> dict: ... cluster_id = ensure_cluster( cluster_name=cluster_name, vpcid=vpcid, ...[truncated 2482 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/ack.py:608
Finding

Kubernetes Job Execution Deletes Pre-existing Same-name Jobs

Content
View full analysis
str: """Execute a script as a K8s Job using the Kubernetes Python SDK.""" ... job = k8s_client.V1Job( api_version="batch/v1", kind="Job", metadata=k8s_client.V1ObjectMeta( name=job_name, namespace=namespace, ), spec=k8s_client.V1JobSpec( backoff_limit=3, ttl_seconds_after_finished=300, template=k8s_client.V1PodTemplateSpec( spec=k8s_client.V1PodSpec( restart_policy="Never", containers=[k8s_client.V1Container( name="runner", image=resolved_image, command=[ "/bin/sh", "-c", f"echo '{encoded_script}' | " f"base64 -d | {interpreter}", ], )], ), ), ), ) try: batch_v1.delete_namespaced_job( job_name, namespace, propagation_policy="Background", ) time.sleep(3) print(f"Cleaned up previous Job '{job_name}'") except ApiException as e: if e.status != 404: raise print(f"Creating Job '{job_name}' (image: {resolved_image})...") batch_v1.create_namespaced_job(namespace, job) ``` ### Technical Analysis The function uses a fixed default Job name, `acf-job`, i ...[truncated 1726 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (64)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description promises a broad orchestration skill that chooses the right Alibaba Cloud compute product across multiple services (ECS, FC, ACK, PAI), including pricing, budget management, provisioning, and script execution. The supplied code chunk does not implement that broad behavior. Instead, it is narrowly focused on ACK: cluster discovery/reuse, cluster creation/deletion, node pool management, kubeconfig retrieval, Kubernetes API access, and running scripts as Kubernetes Jobs. Script execution is consistent with part of the description, but the central advertised capabilities—cross-service compute selection, pricing, and budget control—are absent. This is a material description/behavior mismatch, not just an incomplete snippet of a supporting helper, because the code’s primary purpose is ACK-specific cluster and job management.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description claims a complete Alibaba Cloud compute provisioning and execution skill, including resource selection across ECS/FC/ACK/PAI, pricing/budget handling, instance creation, and script execution. The actual code chunk performs only environment bootstrap: validating Python version and installing required SDK dependencies via pip. While dependency installation can be a supporting implementation detail for a provisioning skill, this chunk by itself does not implement the declared primary functionality. Therefore the declared description materially overstates what the provided code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The description promises a full compute-provisioning loop with service selection, budget/pricing checks, resource creation, and script execution. The supplied code chunk is only a common helper module for making authenticated Alibaba Cloud API calls and waiting on status changes. While these utilities could support such a skill, this chunk by itself does not implement the declared primary behavior. Therefore the description materially overstates what the supplied code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises an end-to-end Alibaba Cloud compute provisioning workflow: interpreting user intent, choosing a resource type, managing pricing/budget constraints, creating compute resources, and executing scripts. The supplied code does none of these things. It only sends a GET request to the Alibaba Cloud documentation search endpoint, parses the returned JSON, and formats documentation search results. Although product names like ecs, fc, ack, and pai appear in the code, they are used only to scope documentation searches by category ID. This is a materially different primary purpose and a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The description overstates the scope and automation level of the skill. The supplied code is a focused ECS management module, not a general Alibaba Cloud compute provisioner across ECS, FC, ACK, and PAI. It does support parts of the declared loop for ECS specifically—instance type recommendation, availability checks, pricing lookup, instance creation, security group setup, and remote script execution. However, there is no code for selecting between multiple compute products based on intent, no provisioning logic for FC/ACK/PAI, and no concrete budget control mechanism beyond returning price information. Because these omitted capabilities are central to the declared purpose rather than incidental details, this is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a broad 'compute provision' skill that chooses the appropriate Alibaba Cloud compute product and manages a full lifecycle including selection, pricing, budget control, instance creation, and script execution. The supplied code does not do that. It is narrowly focused on Function Compute (FC) only. It can create FC functions, upload inline/zipped code, invoke functions synchronously or asynchronously, poll async task status, and optionally delete functions after execution. It also includes helper code to wrap shell/Python scripts for execution inside FC. Those script-execution capabilities partially align with the description's 'executes scripts' aspect, but the primary purpose is materially narrower than advertised. There is no evidence of ECS, ACK, or PAI handling, no pricing/budget logic, and no resource-selection logic based on user intent or keywords. Therefore the description overstates the code's scope in multiple material ways.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description presents a broad compute-provisioning orchestrator that chooses between several Alibaba Cloud compute products and manages a full loop including resource selection, pricing, budget control, instance creation, and script execution. The supplied code chunk is much narrower: it is a PAI-DLC management module. It only interacts with PAI-DLC and AI Workspace APIs, supports job CRUD, workspace auto-creation, image/spec discovery within PAI, log/event retrieval, waiting/diagnostics, and cleanup. While it can execute user commands inside PAI training jobs, it does not implement cross-product selection, pricing, budget enforcement, ECS/FC/ACK provisioning, or general deployment orchestration. This is a material description-behavior mismatch in primary purpose and declared capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description emphasizes end-to-end compute provisioning and execution workflows on Alibaba Cloud. The supplied code does not implement any compute provisioning logic, model training support, script execution, pricing evaluation, or budget enforcement. Its actual purpose is VPC and VSwitch lifecycle management in Alibaba Cloud's VPC service. While networking setup could support compute provisioning in a larger system, this chunk’s primary behavior is materially different from the declared purpose, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

Exposing an API that fetches kubeconfig YAML can grant cluster-admin or broad Kubernetes access if invoked without strict authorization and secret-handling controls. In this skill, the danger is elevated because the same skill can create or reuse clusters and execute jobs, so kubeconfig retrieval could enable persistent access, lateral movement, and data exfiltration beyond the intended task.

Content

Scanner excerpt · references/ack.md (reported line 262)May include surrounding context.

md
### Other APIs

- `describe_regions(region)` -> dict — query available regions
- `get_cluster_kubeconfig(cluster_id, region)` -> str — fetch kubeconfig YAML
- `create_cluster_node_pool(cluster_id, ...)` -> dict — create a node pool
- `describe_cluster_node_pools(cluster_id, region)` -> dict — list node pools

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

This is the same underlying issue as the duplicate PE3 finding: the documented permission retrieves Kubernetes kubeconfig, which functions as sensitive access material. Within this skill’s context, that access is more dangerous because the skill already spans provisioning and execution workflows, making credential abuse operationally impactful.

Content

Scanner excerpt · references/ram-policies.md (reported line 70)May include surrounding context.

md
| `cs:DescribeClustersV1` | 读 | 查询集群列表 |
| `cs:DescribeClusterDetail` | 读 | 查询集群详情与状态 |
| `cs:DescribeClusterNodePools` | 读 | 查询集群节点池列表 |
| `cs:DescribeClusterUserKubeconfig` | 读 | 获取集群 kubeconfig(用于 kubectl 操作) |
| `cs:CreateCluster` | 写 | 创建 ACK 集群 |
| `cs:DeleteCluster` | 写 | 删除 ACK 集群(资源清理) |
| `cs:CreateClusterNodePool` | 写 | 创建集群节点池 |

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

This is the same underlying issue as the duplicate PE3 finding: the documented permission retrieves Kubernetes kubeconfig, which functions as sensitive access material. Within this skill’s context, that access is more dangerous because the skill already spans provisioning and execution workflows, making credential abuse operationally impactful.

Content

Scanner excerpt · references/ram-policies.md (reported line 70)May include surrounding context.

md
| `cs:DescribeClustersV1` | 读 | 查询集群列表 |
| `cs:DescribeClusterDetail` | 读 | 查询集群详情与状态 |
| `cs:DescribeClusterNodePools` | 读 | 查询集群节点池列表 |
| `cs:DescribeClusterUserKubeconfig` | 读 | 获取集群 kubeconfig(用于 kubectl 操作) |
| `cs:CreateCluster` | 写 | 创建 ACK 集群 |
| `cs:DeleteCluster` | 写 | 删除 ACK 集群(资源清理) |
| `cs:CreateClusterNodePool` | 写 | 创建集群节点池 |

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ack.py (reported line 507)May include surrounding context.

python
# ---------------------------------------------------------------------------
# Kubeconfig & Kubernetes SDK helpers
# ---------------------------------------------------------------------------

def get_cluster_kubeconfig(cluster_id: str, region: str | None = None, private: bool = False) -> str:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ack.py (reported line 510)May include surrounding context.

python
# Kubeconfig & Kubernetes SDK helpers
# ---------------------------------------------------------------------------

def get_cluster_kubeconfig(cluster_id: str, region: str | None = None, private: bool = False) -> str:
    """Get kubeconfig YAML string for a cluster.

    Args:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ack.py (reported line 511)May include surrounding context.

python
# Kubeconfig & Kubernetes SDK helpers
# ---------------------------------------------------------------------------

def get_cluster_kubeconfig(cluster_id: str, region: str | None = None, private: bool = False) -> str:
    """Get kubeconfig YAML string for a cluster.

    Args:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ack.py (reported line 514)May include surrounding context.

python
# Kubeconfig & Kubernetes SDK helpers
# ---------------------------------------------------------------------------

def get_cluster_kubeconfig(cluster_id: str, region: str | None = None, private: bool = False) -> str:
    """Get kubeconfig YAML string for a cluster.

    Args:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ack.py (reported line 527)May include surrounding context.

python
# Kubeconfig & Kubernetes SDK helpers
# ---------------------------------------------------------------------------

def get_cluster_kubeconfig(cluster_id: str, region: str | None = None, private: bool = False) -> str:
    """Get kubeconfig YAML string for a cluster.

    Args:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ack.py (reported line 535)May include surrounding context.

python
# Kubeconfig & Kubernetes SDK helpers
# ---------------------------------------------------------------------------

def get_cluster_kubeconfig(cluster_id: str, region: str | None = None, private: bool = False) -> str:
    """Get kubeconfig YAML string for a cluster.

    Args:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ack.py (reported line 537)May include surrounding context.

python
# Kubeconfig & Kubernetes SDK helpers
# ---------------------------------------------------------------------------

def get_cluster_kubeconfig(cluster_id: str, region: str | None = None, private: bool = False) -> str:
    """Get kubeconfig YAML string for a cluster.

    Args:

Credential Access

High
Category
Privilege Escalation
Confidence
81% confidence
Finding

This code calls the ACK user_config endpoint and retrieves kubeconfig credentials for the target cluster. In the context of a skill that automatically provisions compute and executes scripts, this materially increases risk because any compromise or misuse of this code path yields cluster API credentials that can enable workload control, secret access, and lateral movement; the helper defaults to requesting the public kubeconfig when private=False.

Content

Scanner excerpt · scripts/ack.py (reported line 515)May include surrounding context.

python
Args:
        private: If True, return private (VPC-internal) endpoint kubeconfig.
                 If False (default), return public endpoint kubeconfig.
    """
    result = _call(
        f"/k8s/{cluster_id}/user_config",

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

Returning result.get("config", "") exposes raw kubeconfig material directly to callers as a plain string, expanding the blast radius if downstream code logs, caches, serializes, or forwards it. In this skill context, which is designed to run arbitrary user-provided scripts on provisioned compute, direct credential materialization is more dangerous because it creates a reusable secret that can outlive a single API operation.

Content

Scanner excerpt · scripts/ack.py (reported line 521)May include surrounding context.

python
f"/k8s/{cluster_id}/user_config",
        query={"PrivateIpAddress": "true" if private else "false"},
        region=region,
        action="DescribeClusterUserKubeconfig",
    )
    return result.get("config", "")

Credential Access

High
Category
Privilege Escalation
Confidence
82% confidence
Finding

This line obtains raw kubeconfig for a cluster and stores it in process memory, creating a direct credential handling path. In a compute-provisioning skill that executes scripts and may interact with untrusted inputs, unnecessary retrieval and handling of full kubeconfig increases the chance of accidental disclosure or abuse if the process is compromised.

Content

Scanner excerpt · scripts/ack.py (reported line 534)May include surrounding context.

python
import yaml
    from kubernetes import client as k8s_client, config as k8s_config

    kubeconfig_str = get_cluster_kubeconfig(cluster_id, region)
    kubeconfig_dict = yaml.safe_load(kubeconfig_str)

    api_client = k8s_config.new_client_from_config_dict(kubeconfig_dict)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The reusable executor explicitly accepts attacker-controlled payloads and runs them as either bash -c or Python exec, creating a general-purpose remote code execution primitive inside the cloud account. In the context of a compute-provisioning skill, this is more dangerous because it moves beyond provisioning infrastructure into arbitrary code execution without restriction, enabling misuse for persistence, credential access, lateral movement, or unauthorized workloads.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file provides a reusable function that can execute arbitrary shell and Python supplied at invocation time, but contains no in-band warning, approval gate, or trust boundary enforcement. In an agent skill that may be invoked on user intent, that absence of friction materially increases the risk of unsafe or unintended remote code execution in the user's cloud environment.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill directs the agent to execute Python code, access local files, use networked cloud APIs, and potentially invoke shell-like behaviors, but it does not declare any explicit tool scope or permission boundary. That mismatch increases the chance of over-broad execution and makes it harder for a host platform to sandbox dangerous operations before cloud resources are created or scripts are run.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The activation description is broad enough to trigger on common phrases like running scripts, training models, budgets, vCPU, or deployments, which can route ordinary user requests into a highly privileged cloud-provisioning workflow. In this skill's context, over-triggering is more dangerous because activation can lead to billable resource creation and remote code execution against cloud infrastructure.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.