Back to skill

Security audit

huawei-cloud-cdn-list

Security checks for vulnerabilities and agentic risk

Overview

This CDN listing skill needs review because its dependency installer weakens download security and local settings can bypass its advertised read-only protection.

Before installing, have the dependency helper retain certificate verification and use verified, pinned packages in an isolated environment. Verify the CLI installer before executing it. Use credentials restricted to CDN listing and keep executable overrides unset or tightly controlled. The bundled code was inspected, but external downloads and live cloud behavior were not verified.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (1)

T08 · Insecure Dependencies

Error
Location
scripts/ensure_env.py
Finding

Dependency installation disables certificate verification for package indexes

Content
View full analysis

Impact

An active network attacker can substitute an SDK package and execute code with the user's privileges, potentially accessing the cloud credentials available to that process.

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

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% 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_cdn.py (reported line 374)May include surrounding context.

python
)

    def _clean_credential_env(self):
        env = dict(os.environ)
        for name in self._CREDENTIAL_ENV_KEYS:
            env.pop(name, None)
        return env

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 procedure executes a mutable remote shell script without checking a trusted digest or signature, giving its contents the invoking user's privileges. HTTPS protects transport but does not prevent execution of a compromised upstream artifact; the read-only CDN operation does not constrain installer side effects.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
96% confidence
Finding

The subprocess call uses an argument list and is not itself shell injection, but its pip-install callers explicitly mark third-party mirror hosts as trusted, bypassing normal TLS certificate verification for those hosts. Combined with unpinned packages and no trusted hash verification, this allows a network or mirror attacker to supply code that executes during installation or subsequent SDK imports, potentially accessing cloud credentials.

Content

Scanner excerpt · scripts/ensure_env.py (reported line 56)May include surrounding context.

python
def run_cmd(cmd, timeout=300):
    try:
        proc = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            timeout=timeout, universal_newlines=True,
        )

Environment overrides bypass the manifest's strict read-only execution guard.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

The write-intent guard validates user arguments and the operation name, but does not constrain the environment-selected executable or prepended arguments. Consequently, someone controlling those overrides can replace the entire execution path, bypassing the claimed read-only guarantee; actual cloud-write impact still depends on the credentials' IAM permissions.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
94% confidence
Finding

Although subprocess.run uses no shell, the executed program and prepended arguments can both be supplied through environment overrides. An attacker able to influence those variables can select an interpreter or malicious executable rather than hcloud, executing code with the process's privileges and inherited credentials; ordinary domain filter values do not provide this capability.

Content

Scanner excerpt · scripts/list_cdn.py (reported line 235)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 229, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
96% confidence
Finding

CDN_LIST_HCLOUD_BIN and CDN_LIST_HCLOUD_ARGS flow into the executable position and argument list without validation. If a less-trusted launcher or configuration can set them, arbitrary code can run and access the inherited cloud credentials; this is environment-controlled execution, not shell metacharacter injection.

Content

Scanner excerpt · scripts/list_cdn.py (reported line 235)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 hints without a language choice or documented locale justification.

Low
Category
Output Handling
Confidence
86% confidence
Finding

The criteria prescribe specific Chinese messages for empty results and authorization failures. These requirements fix the language of user-facing output without offering user opt-in or explaining a locale-specific need.

Content

No source excerpt is available for this finding.