Back to skill

Security audit

huawei-cloud-dws-list

Security checks for vulnerabilities and agentic risk

Overview

This cloud inventory skill needs review because command overrides bypass its advertised read-only safeguards.

Prefer a corrected version that constrains command overrides, rejects unsupported regions, and accurately documents credential handling. Use dedicated read-only credentials and a trusted CLI in a controlled environment. Offline tests passed with five SDK-dependent skips; live cloud behavior and downloaded installer/dependency contents were not verified.

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

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_dws.py (reported line 370)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_dws.py (reported line 336)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_dws.py (reported line 215)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 209, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
90% confidence
Finding

DWS_LIST_HCLOUD_BIN selects an arbitrary executable, while DWS_LIST_HCLOUD_ARGS supplies unchecked arguments before the fixed DWS command, outside the write-intent guard. If an attacker can influence the inherited environment, these test-oriented hooks permit execution under the agent's identity with its inherited cloud credentials; shell=False does not prevent executable substitution.

Content

Scanner excerpt · scripts/list_dws.py (reported line 215)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 guesses an endpoint from unvalidated region input despite documenting official endpoints with “no guessing.”

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

The SDK fallback interpolates an unvalidated region into a URL, so URI delimiters can move the apparent myhuaweicloud.com suffix into the path rather than keep it in the hostname. For example, a region shaped like attacker.example/ produces a hostname of dws.attacker.example, potentially directing authenticated SDK traffic to an attacker-controlled service when the CLI is absent; this does not imply the secret key itself is transmitted.

Content

No source excerpt is available for this finding.

The credential-error diagnostic is fixed in Chinese without a user language choice.

Low
Category
Output Handling
Confidence
90% confidence
Finding

The guide specifies that credential problems are surfaced as 缺少 AK/SK 凭证, requiring a Chinese diagnostic regardless of the user's language. It provides neither language opt-in nor a documented justification for this locale constraint.

Content

No source excerpt is available for this finding.