Back to skill

Security audit

huawei-cloud-ges-graph

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real Huawei Cloud GES/OBS operator with credential use and destructive cloud actions, but its safeguards and transport security are not strong enough for automatic agent use.

Install only if you intend to let an agent operate a Huawei Cloud GES graph with scoped test credentials. Avoid production credentials unless the skill is revised to enforce TLS verification, use HTTPS for GES, require explicit confirmations or force flags for destructive actions, and restrict OBS operations to approved buckets and prefixes.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (23)

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill documents execution of local Python/Node scripts that read environment variables, access local files such as .env/ges_env.csv, and make outbound network requests to Huawei Cloud, yet no explicit permissions are declared. This weakens transparency and policy enforcement because an agent or reviewer may underestimate the skill's ability to access credentials and external services.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The metadata presents the skill as an access guide, but the body clearly enables real execution against live cloud resources, including IAM authentication, graph mutation, import/export to OBS, and destructive operations like clearing graph data. This mismatch can cause users or calling agents to invoke the skill with lower scrutiny than warranted, increasing the chance of credential exposure, data exfiltration, or destructive changes.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
The document says direct API calls are prohibited, but later provides an example using a low-level _request method to call the GES API directly. Conflicting safety instructions create ambiguity that can bypass intended guardrails and encourage unsafe use of undocumented or less-reviewed code paths.

Intent-Code Divergence

Medium
Confidence
78% confidence
Finding
The graph management example references a memory-specific destructive method, clear_all_memories(), that does not match the stated GES interface and appears to normalize a dangerous bulk-delete action. Inconsistent destructive API examples increase the risk of accidental misuse, especially in an agent setting where examples may be copied verbatim.

Description-Behavior Mismatch

High
Confidence
94% confidence
Finding
The skill advertises itself as an access guide, but the implementation can perform live state-changing operations including graph mutation, import/export, and deletion. This mismatch is dangerous because users or higher-level agents may invoke it under a lower-risk assumption and unintentionally cause destructive actions in a production graph.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The code contains a full OBS client with upload, download, delete, and object listing features, which expands the skill beyond described GES guidance/operation. Hidden storage-management capability increases risk of data exfiltration, tampering, or unexpected file operations when the caller believes the skill only interacts with the graph service.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
Standalone OBS object management is broader than necessary for a graph-database terminal skill and enables unrelated remote file operations. In an agent setting, this unnecessarily widens the attack surface and can be abused for unauthorized data staging, deletion, or retrieval from cloud storage.

Intent-Code Divergence

Medium
Confidence
88% confidence
Finding
The module header describes node/edge operations and import/export but omits especially destructive capabilities such as clearing the entire graph and deleting nodes, edges, or OBS objects. Inadequate disclosure can cause operators and orchestration layers to treat the tool as lower risk than it actually is.

Context-Inappropriate Capability

Medium
Confidence
77% confidence
Finding
The code loads sensitive cloud credentials, passwords, and tokens from environment variables and a local .env CSV file, expanding secret exposure within a skill that users may not expect to handle credentials directly. In an agent-skill context, this increases the blast radius if the skill is invoked unexpectedly, logged, or combined with network actions elsewhere in the file.

Vague Triggers

Medium
Confidence
84% confidence
Finding
The trigger list includes broad terms such as graph database, 查询图数据库, and related generic phrases that can match ordinary requests not intended for this specific skill. Overbroad activation increases the chance that an execution-capable skill is invoked inappropriately, exposing credentials or modifying external systems without strong user intent.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The import/export section enables movement of graph data to external OBS storage but does not give a prominent warning about data transfer, privacy, or security implications. In a cloud database context, export/import features can facilitate large-scale exfiltration or unintended replication of sensitive graph data.

Missing User Warnings

High
Confidence
95% confidence
Finding
The skill exposes a graph-clearing operation that can wipe all graph data with no confirmation, dry-run, scoping, or safety interlock. In an agent context this is especially dangerous because a mistaken invocation, prompt injection, or ambiguous user request could irreversibly destroy production data.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The OBS delete operation removes remote objects directly without any confirmation or guardrails. If invoked unintentionally or by a compromised workflow, it can cause permanent loss of stored data associated with imports, exports, or other cloud assets.

Missing User Warnings

High
Confidence
91% confidence
Finding
Destructive delete operations on graph nodes execute immediately with no confirmation, policy check, or safety interlock. In an agent-executed skill, a mistaken invocation, prompt injection chain, or misuse could irreversibly remove graph data and relationships.

Missing User Warnings

High
Confidence
97% confidence
Finding
The clear_graph method can irreversibly remove all graph data through either a dedicated API or a fallback Cypher delete, with no confirmation or protection. In this skill context, that is especially dangerous because the module is packaged as a reusable agent capability, increasing the chance of accidental or manipulated invocation with catastrophic data loss.

External Transmission

Medium
Category
Data Exfiltration
Content
}
            }

        resp = requests.post(url, headers=headers, json=data, timeout=30, verify=False)

        if resp.status_code not in [200, 201]:
            raise Exception(f"密码获取Token失败: {resp.status_code}, {resp.text[:200]}")
Confidence
95% confidence
Finding
The password-based token request transmits highly sensitive credentials to a remote IAM endpoint. Because this code also disables TLS verification for the request, an attacker positioned on the network could intercept or tamper with authentication traffic, leading to credential theft and cloud-account compromise.

Env Variable Harvesting

High
Category
Data Exfiltration
Content
if self.token and current_time < self.token_expiry - 300:
            return self.token

        env_token = os.environ.get('GES_TOKEN')
        if env_token:
            self.token = env_token
            self.token_expiry = time.time() + 3600 * 23
Confidence
83% confidence
Finding
Reading bearer tokens directly from environment variables is common, but in an agent skill it becomes a security issue when paired with broad network capabilities and little isolation. Any unintended invocation of this skill can silently leverage ambient credentials, increasing the risk of unauthorized actions against cloud resources.

Credential Access

High
Category
Privilege Escalation
Content
edge_path="obs://bucket/edge"
)

# Export graph data (access_key/secret_key are read from .env automatically)
job_id = skill.client.export_graph(
    export_path="obs://bucket/export",
    vertex_set_name="set_vertex",
Confidence
89% confidence
Finding
The documentation states that access_key/secret_key are read automatically from .env during export operations, confirming credential access from local configuration. Automatic credential consumption in an execution-capable skill raises the risk of unintended secret use, unauthorized cloud operations, and accidental disclosure through logs or error handling.

Credential Access

High
Category
Privilege Escalation
Content
class EnvConfig:
    """环境配置管理 - 支持环境变量和配置文件读取"""

    ENV_DIR = os.path.join(SKILL_DIR, '.env')

    ENV_VAR_MAPPING = {
        'GES_GRAPH_IP': 'graph_ip',
Confidence
90% confidence
Finding
The skill accesses a local .env directory and supports reading plaintext credentials such as passwords and cloud keys from a CSV file. Storing and consuming secrets from local project files significantly increases the chance of accidental disclosure through source control, filesystem exposure, backups, or other tooling in the agent environment.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
}
            }

        resp = requests.post(url, headers=headers, json=data, timeout=30, verify=False)

        if resp.status_code not in [200, 201]:
            raise Exception(f"密码获取Token失败: {resp.status_code}, {resp.text[:200]}")
Confidence
99% confidence
Finding
The IAM token request disables TLS certificate verification with verify=False while sending authentication material. This permits man-in-the-middle interception or modification of requests and responses, potentially exposing usernames, passwords, and issued tokens.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
'X-Identity-Sign': authorization_header
        }

        resp = requests.post(url, data=Body, headers=headers, timeout=30, verify=False)

        if resp.status_code not in [200, 201]:
            raise Exception(f"AKSK获取Token失败: {resp.status_code}, {resp.text[:200]}")
Confidence
99% confidence
Finding
The AK/SK-based token request also disables TLS verification, exposing signed authentication exchanges to interception or tampering. Even if the secret key is not sent directly, a MITM can manipulate responses or capture tokens, undermining the trust model of the cloud authentication flow.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
url=url,
            headers=request_headers,
            data=body,
            verify=False
        )

        if response.status_code >= 400:
Confidence
98% confidence
Finding
The OBS client sends upload, download, and delete requests with TLS verification disabled, allowing object contents and authorization headers to be intercepted or modified. This can result in data exfiltration, malicious file substitution, or unauthorized object deletion in cloud storage.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
url = f"{self.base_url}{path}"
        headers = self._get_headers()

        resp = requests.request(method, url, headers=headers, **kwargs, verify=False)

        if resp.status_code >= 400:
            raise Exception(f"API请求失败 [{resp.status_code}]: {resp.text}")
Confidence
99% confidence
Finding
All GES API requests are made with verify=False, exposing graph queries, mutations, tokens, and administrative operations to man-in-the-middle attacks. In this skill, that risk is amplified because the client includes destructive graph operations and can act with cloud credentials automatically.

Static analysis

Detected: suspicious.insecure_tls_verification

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
scripts/ges_graph_skill.js:603

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
scripts/ges_graph_skill.py:179