Back to skill

Security audit

huawei-cloud-apig-instance-list

Security checks for vulnerabilities and agentic risk

Overview

The inventory queries are read-only, but the installer and unrestricted command overrides need review before use.

Review the installation instructions before use. Obtain KooCLI through Huawei's documented downloads and verify integrity rather than executing the supplied installer URL. Remove or restrict the executable and argument override hooks; until then, keep both APIG_LIST_HCLOUD_* variables unset in a trusted environment. Use read-only cloud credentials configured outside chat. The SDK reads those credentials into memory. External installer and dependency contents were not audited.

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
  • 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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (6)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The only supplied executable command is python3 -m unittest discover -s tests -v. Its observable purpose is running tests, not querying Huawei Cloud APIG. Although tests could support a larger implementation, no such implementation or test contents are supplied, so this chunk does not substantiate the declared functionality. The behavior of any discovered tests cannot be determined from this command alone.

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.

The installation workflow executes a downloaded shell script without warning about its system-level effects.

Medium
Category
Output Handling
Confidence
95% confidence
Finding

The installation instructions execute a mutable remote shell script without a pinned version, independent integrity verification, or review step. HTTPS protects transport but does not prevent a compromised distribution source from supplying code that runs with the user's local privileges and could access cloud credentials; this installation step is outside the inventory tool's read-only guarantees.

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_apig_instances.py (reported line 349)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 340, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
91% confidence
Finding

APIG_LIST_HCLOUD_BIN selects the executable and APIG_LIST_HCLOUD_ARGS inserts unchecked arguments before the fixed APIG command, bypassing the operation guard's assumptions. If an attacker can influence the inherited environment, these production-active test hooks can execute an attacker-selected program with the agent's privileges and inherited credentials; this is executable/argument injection rather than shell injection.

Content

Scanner excerpt · scripts/list_apig_instances.py (reported line 349)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,
        )

The SDK fallback directly reads AK/SK credentials despite the module's explicit claim that the script never reads credentials.

Low
Category
Excessive Agency
Confidence
100% confidence
Finding

L013-L015 claim that the script never reads credentials and delegates authentication to the KooCLI profile or SDK environment. In contrast, L536-L537 explicitly retrieve AK/SK through _env_value(), which reads os.environ at L487-L492, and L554-L555 pass those secrets into BasicCredentials; this contradicts the documented credential-handling boundary, although credential access itself is justified for SDK authentication.

Content

No source excerpt is available for this finding.