Back to skill

Security audit

huawei-cloud-voucher-list

Security checks for vulnerabilities and agentic risk

Overview

This voucher lookup tool needs review because executable overrides can bypass its read-only guard, and its credential handling contradicts its main instructions.

Before installing, remove or constrain the executable overrides and correct the credential-handling documentation. Use a trusted CLI installation, an isolated read-only account, and explicitly selected credentials rather than an environment containing several Huawei accounts. The current overrides are documented only in the script header. External installation payloads and live SDK behavior were not verified; no malicious behavior was established.

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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/list_voucher.py (reported line 465)May include surrounding context.

python
)

    def _env_credential(markers):
        for key, value in os.environ.items():
            upper = key.upper()
            if not upper.startswith(("HUAWEI", "HW_", "HWC")):
                continue

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_list_voucher.py (reported line 407)May include surrounding context.

python
def _clean_credential_env(self):
        return {
            key: value for key, value in os.environ.items()
            if not key.upper().startswith(("HUAWEI", "HW_", "HWC"))
        }

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_voucher.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 275, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
88% confidence
Finding

VOUCHER_LIST_HCLOUD_BIN selects an unrestricted executable, while VOUCHER_LIST_HCLOUD_ARGS supplies unrestricted arguments before the validated BSS operation. If an attacker can influence the agent's inherited environment, these overrides allow arbitrary execution outside the read-only operation guard, with access to inherited cloud credentials; this is conditional on environment control, not injection through ordinary query arguments.

Content

Scanner excerpt · scripts/list_voucher.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,
        )

Acceptance criteria require Chinese-language user-facing messages without a language choice or documented locale justification.

Low
Category
Output Handling
Confidence
94% confidence
Finding

The empty-result and permission-error criteria prescribe specific Chinese messages. Neither criterion offers language selection or documents why these messages must remain Chinese regardless of the user's language.

Content

No source excerpt is available for this finding.