Back to skill

Security audit

huawei-cloud-nat-list

Security checks for vulnerabilities and agentic risk

Overview

This inventory skill needs review because its read-only safeguards have bypasses and unchecked region settings can direct its credentialed SDK client outside Huawei Cloud.

Before installing, have the production executable overrides removed or restricted and region values validated against trusted endpoints. Use dedicated credentials limited to nat:natGateways:list, configure them outside chat, and install KooCLI from a verified vendor distribution. The review found concrete safeguard weaknesses, not evidence of intentional malicious behavior. Real cloud execution and the downloaded installer remain unverified.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (6)

Environment-controlled execution hooks bypass the promised strictly read-only operation guard.

High
Category
Excessive Agency
Confidence
98% confidence
Finding

The operation guards validate user arguments, but run_hcloud subsequently accepts executable and argument overrides from the environment without applying equivalent restrictions. An attacker controlling those variables can substitute a program that ignores ListNatGateways entirely, defeating the read-only execution promise and potentially accessing local secrets or performing cloud writes if the available credentials permit them.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/list_nat_gateways.py (reported line 281)May include surrounding context.

python
cmd.extend(extra)
    cmd.extend(argv)
    try:
        proc = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            timeout=120, universal_newlines=True,
        )

Tainted flow: 'cmd' from os.environ.get (line 272, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
95% confidence
Finding

NAT_LIST_HCLOUD_BIN selects an unrestricted executable, and NAT_LIST_HCLOUD_ARGS supplies unchecked arguments before the fixed NAT command. If an attacker can influence the inherited environment, these hooks permit execution of an attacker-selected program with the agent's privileges and inherited credentials; shell=False does not prevent executable substitution.

Content

Scanner excerpt · scripts/list_nat_gateways.py (reported line 281)May include surrounding context.

python
cmd.extend(extra)
    cmd.extend(argv)
    try:
        proc = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            timeout=120, universal_newlines=True,
        )

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · tests/test_list_nat_gateways.py (reported line 340)May include surrounding context.

python
def test_pagination_stops_when_marker_repeats(self):
        # Infinite-loop guard: a server repeating the same page must not cause
        # an unbounded request loop.
        page = {"nat_gateways": [GATEWAY_1]}
        fake = FakeRunner([(json.dumps(page), "", 0), (json.dumps(page), "", 0)])
        with mock.patch("list_nat_gateways.subprocess.run", fake):

Acceptance criteria require Chinese-language error and empty-result messages without a documented locale choice or justification.

Low
Category
Output Handling
Confidence
91% confidence
Finding

These criteria prescribe specific Chinese text for empty results and permission errors, making the language mandatory for those outputs. The file provides no user opt-in, locale selection, or region-specific justification for that requirement.

Content

No source excerpt is available for this finding.