Back to skill

Security audit

huawei-cloud-storage-query

Security checks for vulnerabilities and agentic risk

Overview

This storage-query skill needs review because setup and cloud queries bypass connection security, and setup requires unnecessary identity access.

Wait for certificate verification to be restored for cloud calls and dependency installation, and for setup to stop requiring IAM user listing. Prefer locked, hash-verified dependencies and narrowly scoped, temporary read-only credentials. Keep cached results private and delete them when finished. Treat recycle-bin enablement as a separate administrative decision. This assessment used static inspection, without installing dependencies or accessing a cloud account.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config.py
Finding

Cloud API clients disable TLS certificate verification

Content
View full analysis

Impact

An interceptor can read requested cloud inventory and object data in transit and falsify returned resource details. This does not establish disclosure of the secret access key, which is used for request signing.

T08 · Insecure Dependencies

Error
Location
scripts/ensure_env.py
Finding

Dependency installation trusts unauthenticated mirror connections

Content
View full analysis

Impact

Arbitrary code execution during installation or subsequent SDK import, with access to the process environment containing HW_ACCESS_KEY, HW_SECRET_KEY, and any configured temporary security token.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (30)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

Environment creation and dependency installation are supporting implementation details and are not independently treated as mismatches. However, the executed credential check retrieves an IAM user list, rather than querying the declared storage resources, introducing an undeclared identity-resource access requirement. The project-listing helper adds another out-of-scope read capability, although it is not called by main. The code does not demonstrate cloud writes, so the read-only cloud-operation claim is not contradicted.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The code is read-only, consistent with the no-write restriction, and uses the CBR SDK. However, its sole operation retrieves tenant/project identity metadata rather than the declared backup, vault, policy, task, agent, or protectable resources. This is the script's primary output, not merely an implementation detail supporting a storage-resource query.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/check_env.sh (reported line 39)May include surrounding context.

sh
echo ""
    echo "请先安装 Python 3.6+,根据当前系统参考:"
    echo "  macOS   : brew install python"
    echo "  Ubuntu  : sudo apt update && sudo apt install -y python3 python3-pip"
    echo "  CentOS  : sudo yum install -y python3"
    exit 1
fi

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

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

python
print()
    info("请安装 Python 3.6+ 后重试,参考:")
    print("    Windows : winget install Python.Python.3.11")
    print("    Ubuntu  : sudo apt update && sudo apt install -y python3 python3-pip python3-venv")
    print("    CentOS  : sudo yum install -y python3 python3-pip")
    print("    Fedora  : sudo dnf install -y python3 python3-pip")
    print("    macOS   : brew install python@3.11")

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

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

python
# 用 venv Python 重新执行当前脚本
    print(f"  使用虚拟环境 Python: {venv_python}")
    os.execv(venv_python, [venv_python] + sys.argv)

def info(msg):
    print(f"  {msg}")

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, network, 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.

Local caching of cloud query results is required without warning about persistence of potentially sensitive resource data.

Medium
Category
Output Handling
Confidence
94% confidence
Finding

The skill repeatedly directs local caching without specifying access controls, retention, or cleanup. Storage inventories, object names, policies, and infrastructure details can consequently persist in shared or backed-up locations beyond the authorized query session.

Content

No source excerpt is available for this finding.

Troubleshooting instructions recommend enabling an account feature without warning that this changes storage and deletion behavior.

Medium
Category
Output Handling
Confidence
92% confidence
Finding

The guide recommends changing an account feature to resolve a read-only query restriction without explaining the consequences or separating the change from routine troubleshooting. Enabling a recycle bin changes deletion and retention behavior and can affect storage costs, although the supplied instructions require a manual console action rather than performing the change automatically.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/check_env.sh (reported line 39)May include surrounding context.

sh
echo ""
    echo "请先安装 Python 3.6+,根据当前系统参考:"
    echo "  macOS   : brew install python"
    echo "  Ubuntu  : sudo apt update && sudo apt install -y python3 python3-pip"
    echo "  CentOS  : sudo yum install -y python3"
    exit 1
fi

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/check_env.sh (reported line 39)May include surrounding context.

sh
echo ""
    echo "请先安装 Python 3.6+,根据当前系统参考:"
    echo "  macOS   : brew install python"
    echo "  Ubuntu  : sudo apt update && sudo apt install -y python3 python3-pip"
    echo "  CentOS  : sudo yum install -y python3"
    exit 1
fi

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/check_env.sh (reported line 40)May include surrounding context.

sh
echo "请先安装 Python 3.6+,根据当前系统参考:"
    echo "  macOS   : brew install python"
    echo "  Ubuntu  : sudo apt update && sudo apt install -y python3 python3-pip"
    echo "  CentOS  : sudo yum install -y python3"
    exit 1
fi

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

python
print()
    info("请安装 Python 3.6+ 后重试,参考:")
    print("    Windows : winget install Python.Python.3.11")
    print("    Ubuntu  : sudo apt update && sudo apt install -y python3 python3-pip python3-venv")
    print("    CentOS  : sudo yum install -y python3 python3-pip")
    print("    Fedora  : sudo dnf install -y python3 python3-pip")
    print("    macOS   : brew install python@3.11")

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

python
print()
    info("请安装 Python 3.6+ 后重试,参考:")
    print("    Windows : winget install Python.Python.3.11")
    print("    Ubuntu  : sudo apt update && sudo apt install -y python3 python3-pip python3-venv")
    print("    CentOS  : sudo yum install -y python3 python3-pip")
    print("    Fedora  : sudo dnf install -y python3 python3-pip")
    print("    macOS   : brew install python@3.11")

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

python
info("请安装 Python 3.6+ 后重试,参考:")
    print("    Windows : winget install Python.Python.3.11")
    print("    Ubuntu  : sudo apt update && sudo apt install -y python3 python3-pip python3-venv")
    print("    CentOS  : sudo yum install -y python3 python3-pip")
    print("    Fedora  : sudo dnf install -y python3 python3-pip")
    print("    macOS   : brew install python@3.11")

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

python
print("    Windows : winget install Python.Python.3.11")
    print("    Ubuntu  : sudo apt update && sudo apt install -y python3 python3-pip python3-venv")
    print("    CentOS  : sudo yum install -y python3 python3-pip")
    print("    Fedora  : sudo dnf install -y python3 python3-pip")
    print("    macOS   : brew install python@3.11")

The documented mandatory project-service API validation is never performed.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The module documentation at L10-L13 explicitly promises both IAM credential validation and an actual ECS API call, and says all steps must pass before the environment is ready. However, main() at L492-L524 performs only five checks ending with IAM validation and then reports success, without any ECS or equivalent project-service API validation.

Content

No source excerpt is available for this finding.

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% 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 · scripts/ensure_env.py (reported line 129)May include surrounding context.

python
# ── 工具函数 ──────────────────────────────────────────────────────────

def run_cmd(cmd, timeout=None, **kwargs):
    """运行命令,返回 (returncode, stdout, stderr)

    Args:

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/ensure_env.py (reported line 137)May include surrounding context.

python
timeout: 超时秒数,超时后终止子进程并返回失败
    """
    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, **kwargs)
        return result.returncode, result.stdout.strip(), result.stderr.strip()
    except subprocess.TimeoutExpired:
        return -1, "", f"命令超时({timeout}s): {' '.join(cmd)}"

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

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

python
core_modules = ["huaweicloudsdkcore", "huaweicloudsdkecs", "huaweicloudsdkiam"]
    for mod in core_modules:
        try:
            __import__(mod)
        except ImportError:
            return False
    return True

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

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

python
all_ok = True
    for mod in SDK_MODULES:
        try:
            __import__(mod)
            print(f"  {mod}")
        except ImportError:
            print(f"  {mod} 不可导入")

Credential validation enumerates IAM users outside the storage-query purpose.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The mandatory readiness check lists IAM users even though the skill's purpose is querying storage resources. This unnecessarily accesses identity information and makes successful setup depend on IAM user-listing permission, encouraging broader credentials than a storage-only role needs; the one-user limit reduces exposure but does not remove the permission mismatch.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
70% confidence
Finding

Overly Broad Trigger: '备份' is too short and may match unintended inputs

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
70% confidence
Finding

Overly Broad Trigger: '快照' is too short and may match unintended inputs

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
70% confidence
Finding

Overly Broad Trigger: '桶' is too short and may match unintended inputs

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The open-ended core SDK requirement allows installation of future, unreviewed releases instead of a reproducible dependency set. A compromised release could execute in the credential-bearing query process; the requirement is a supply-chain weakness, not evidence of an existing compromise.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
huaweicloudsdkcore>=3.1.0
huaweicloudsdkiam>=3.1.0
huaweicloudsdkevs>=3.1.0
huaweicloudsdksfsturbo>=3.1.0